--- /dev/null
+# Top-level Makefile for Win95/DJGPP AFS client
+# Assumes you are doing cross-compiling from Linux
+# Set LINUX_SYS to the proper sysname for your Linux system
+
+OBJ = $(SYS_NAME)/obj
+DEST = $(SYS_NAME)/dest
+#LINUX_SYS = i386_linux22
+
+all: afsd
+
+afsd: config pinstall libs
+ make -C $(OBJ)/WINNT/afsd -f Makefile.djgpp depends
+ make -C $(OBJ)/WINNT/afsd -f Makefile.djgpp install
+
+utils: pinstall rxgen comerr
+includes: afsdinc osiinc authinc
+libs: fsint cmd lwp osi rx rxkad vldb rxstat acl
+
+clean:
+ -rm -f $(SYS_NAME)/dest/include/*
+ -rm -f $(SYS_NAME)/dest/include/afs/*
+ -rm -f $(SYS_NAME)/dest/lib/*
+ -rm -f $(SYS_NAME)/dest/lib/afs/*
+ -rm -f $(SYS_NAME)/dest/bin/*
+
+config:
+ -make -C $(OBJ)/config install
+
+# pinstall, rxgen, comerr, and util are built to run on Linux
+pinstall: config
+ -mkdir $(OBJ)/pinstall/afs
+ -cp $(OBJ)/config/param.$(LINUX_SYS).h $(OBJ)/pinstall/afs/param.h
+ make -C $(OBJ)/pinstall SYS_NAME=$(LINUX_SYS) install
+rxgen: config
+ -mkdir $(OBJ)/rxgen/afs
+ -cp $(OBJ)/config/param.$(LINUX_SYS).h $(OBJ)/rxgen/afs/param.h
+ make -C $(OBJ)/rxgen SYS_NAME=$(LINUX_SYS) install
+comerr: config util
+ -mkdir $(OBJ)/comerr/afs
+ -cp $(OBJ)/config/param.$(LINUX_SYS).h $(OBJ)/comerr/afs/param.h
+ make -C $(OBJ)/comerr SYS_NAME=$(LINUX_SYS) install
+util: config procmgmt
+ -mkdir $(OBJ)/util/afs
+ -cp $(OBJ)/util/param.$(LINUX_SYS).h $(OBJ)/util/afs/param.h
+ make -C $(OBJ)/util SYS_NAME=$(LINUX_SYS) install
+
+procmgmt:
+ make -C $(OBJ)/procmgmt includes
+lwp: util afsdinc osiinc lwpinc
+ make -C $(OBJ)/lwp install
+lwpinc:
+ make -C $(OBJ)/lwp includes
+rx: rxgen lwp
+ make -C $(OBJ)/rx install-djgpp
+des: desprogs
+ make -C $(OBJ)/des install
+desprogs:
+ make -C $(OBJ)/des SYS_NAME=$(LINUX_SYS) gprogs
+ubik: rx lwp
+ make -C $(OBJ)/ubik install
+fsint: rx rxgen
+ make -C $(OBJ)/fsint install
+rxkad: rx des
+ make -C $(OBJ)/rxkad install
+audit: fsint
+ make -C $(OBJ)/audit install
+authinc: comerr
+ make -C $(OBJ)/auth includes
+vldb: rxgen rx authinc audit ubik rxkad
+ make -C $(OBJ)/vlserver libinstall
+rxstat: rxgen rx
+ make -C $(OBJ)/rxstat install
+cmd: comerr
+ make -C $(OBJ)/cmd install
+afsdinc:
+ make -C $(OBJ)/WINNT/afsd -f Makefile.djgpp includes
+osiinc:
+ make -C $(OBJ)/WINNT/client_osi -f Makefile.djgpp includes
+osi: config
+ make -C $(OBJ)/WINNT/client_osi -f Makefile.djgpp depends
+ make -C $(OBJ)/WINNT/client_osi -f Makefile.djgpp install
+acl: config ptlib
+ make -C $(OBJ)/libacl install
+ptlib: config rxgen comerr
+ make -C $(OBJ)/ptserver libinstall
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+# Top level nmake NTMakefile driver for building AFS.
+#
+# This file simply imposes a reasonable total ordering on the set of
+# directories to build; this ordering is of course more strict than the
+# partial ordering established by the actual directory dependencies.
+#
+# When porting a new directory, simply add the directory into the
+# dependence chain at the earliest point possible, updating its successor
+# appropriately; if the new directory is the last in the chain, then
+# update the 'finale' dependency to be the new directory.
+
+
+CD = cd
+NTMAKE = nmake /nologo /f ntmakefile install9x
+NTMAKELANG = nmake /nologo /f ntmakefile en_install
+NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
+NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile install_libutils
+MKDIR = mkdir
+OBJ = src
+
+# Standard install directory.
+!IFDEF AFSDEV_DESTDIR
+DESTDIR = $(AFSDEV_DESTDIR)
+!ELSE
+DESTDIR = $(AFSROOT)\DEST
+!ENDIF
+
+
+start:
+! IF (!EXIST(src))
+! ERROR Execute nmake from directory above src, e.g., afs\3.5.
+! ENDIF
+! IF (!EXIST($(DESTDIR)))
+ $(MKDIR) $(DESTDIR)
+! ENDIF
+
+config:
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+procmgmt_headers: config
+ echo ***** $@
+ $(CD) $(OBJ)\procmgmt
+ $(NTMAKE_HEADERS)
+ $(CD) ..\..
+
+afsreg_headers: config
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\afsreg
+ $(NTMAKE_HEADERS)
+ $(CD) ..\..\..
+
+util: procmgmt_headers afsreg_headers
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+comerr: util
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+cmd: comerr
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+afsreg: cmd
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+eventlog: afsreg
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+lwp: eventlog
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+rxgen: lwp
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+des: rxgen
+ echo ***** $@
+! IF (EXIST($(OBJ)\des\NTMakefile))
+ $(CD) $(OBJ)\des
+ $(NTMAKE)
+ $(CD) ..\..
+! ELSE
+ $(CD) $(OBJ)\des_stub
+ $(NTMAKE)
+ $(CD) ..\..
+! ENDIF
+
+rx: des
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+rxstat: rx
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+rxkad: rxstat
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+pthread: rxkad
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+procmgmt: pthread
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+fsint: procmgmt
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+audit: fsint
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+osi_headers: audit
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\client_osi
+ $(NTMAKE_HEADERS)
+ $(CD) ..\..\..
+
+libacl_headers: osi_headers
+ echo ***** $@
+ $(CD) $(OBJ)\libacl
+ $(NTMAKE_HEADERS)
+ $(CD) ..\..
+
+cm_headers: libacl_headers
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\afsd
+ $(NTMAKE_HEADERS)
+ $(CD) ..\..\..
+
+sys: cm_headers
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+auth: sys
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+ubik: auth
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+ptserver: ubik
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE_LIBUTILS)
+ $(CD) ..\..
+
+libacl: ptserver
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+kauth: libacl
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+vlserver: kauth
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE_LIBUTILS)
+ $(CD) ..\..
+
+usd: vlserver
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+libafsrpc: usd
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+libafsauthent: libafsrpc
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+libadmin: libafsauthent
+ echo ***** $@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
+
+client_talocale: libadmin
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\talocale
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+client_osi: client_talocale
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+afsd: client_osi
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE_LIBUTILS)
+ $(CD) ..\..\..
+
+client_cpa: afsd
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+client_config: client_cpa
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+client_exp: client_config
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+
+#Leave last echo in - it helps the build reconize the last $(CD)
+win9xpanel :
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+ echo ***** End of Build
+
+install: start client_exp win9xpanel
+
+install9x: install
+
+# InstallShield dependencies
+
+#Leave last echo in - it helps the build reconize the last $(CD)
+Win9x::
+ $(CD) $(OBJ)\WINNT\install\$@
+ nmake /nologo /f NTMakefile install9x
+ $(CD) ..\..\..\..
+ echo **** End of Install Scripts
+
+media: Win9x
+
+# Clean target for obj tree
+# Fake the version copy so clean will go through the complete cycle with undefines
+clean: start
+ if not exist .\src\config\NTMakefile.version copy .\src\config\NTMakefile.version-NOCML .\src\config\NTMakefile.version
+ nmake /nologo /f ntmake9x "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile clean" install
+ $(CD) $(OBJ)\WINNT\install\Win9x
+ nmake /nologo /f NTMakefile clean
+ $(CD) ..\..\..\..
+ .\src\rmbat $(DESTDIR)\include\*.* $(DESTDIR)\include\afs\*.* $(DESTDIR)\include\WINNT\*.* $(DESTDIR)\include\rx\*.*
+ .\src\rmbat $(DESTDIR)\LIB\*.LIB $(DESTDIR)\LIB\*.DLL $(DESTDIR)\LIB\AFS\*.LIB
+ .\src\RMBAT $(DESTDIR)\root.client\usr\vice\etc\*.*
+ $(CD) $(OBJ)\config
+ nmake /nologo /f ntmakefile clean_version
+ $(CD) ..\..
+ echo **** End of Clean
+
+# Language-only build target
+lang:
+ nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile lang" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile lang" install
CD = cd
NTMAKE = nmake /nologo /f ntmakefile install
+NTMAKELANG = nmake /nologo /f ntmakefile en_US
NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
MKDIR = mkdir
+OBJ = obj
# Standard install directory.
!IFDEF AFSDEV_DESTDIR
! ENDIF
config:
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
procmgmt_headers: config
- $(CD) src\procmgmt
+ echo ***** $@
+ $(CD) $(OBJ)\procmgmt
$(NTMAKE_HEADERS)
$(CD) ..\..
afsreg_headers: config
- $(CD) src\WINNT\afsreg
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\afsreg
$(NTMAKE_HEADERS)
$(CD) ..\..\..
util: procmgmt_headers afsreg_headers
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
comerr: util
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
cmd: comerr
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
afsreg: cmd
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
eventlog: afsreg
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
lwp: eventlog
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
rxgen: lwp
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
des: rxgen
-! IF (EXIST(src\des\NTMakefile))
- $(CD) src\des
+ echo ***** $@
+! IF (EXIST($(OBJ)\des\NTMakefile))
+ $(CD) $(OBJ)\des
$(NTMAKE)
$(CD) ..\..
! ELSE
- $(CD) src\des_stub
+ $(CD) $(OBJ)\des_stub
$(NTMAKE)
$(CD) ..\..
! ENDIF
rx: des
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
rxstat: rx
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
rxkad: rxstat
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
pthread: rxkad
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
procmgmt: pthread
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
fsint: procmgmt
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
audit: fsint
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
osi_headers: audit
- $(CD) src\WINNT\client_osi
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\client_osi
$(NTMAKE_HEADERS)
$(CD) ..\..\..
libacl_headers: osi_headers
- $(CD) src\libacl
+ echo ***** $@
+ $(CD) $(OBJ)\libacl
$(NTMAKE_HEADERS)
$(CD) ..\..
cm_headers: libacl_headers
- $(CD) src\WINNT\afsd
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\afsd
$(NTMAKE_HEADERS)
$(CD) ..\..\..
sys: cm_headers
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
auth: sys
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
ubik: auth
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
ptserver: ubik
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
libacl: ptserver
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
kauth: libacl
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
vlserver: kauth
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
usd: vlserver
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
bubasics: usd
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
budb: bubasics
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
butm: budb
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
dir: butm
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
vol: dir
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
volser: vol
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
viced: volser
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
update: viced
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
bucoord: update
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
butc: bucoord
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
bozo: butc
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
bosctlsvc: bozo
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
bu_utils: bosctlsvc
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
libafsrpc: bu_utils
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
libafsauthent: libafsrpc
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
tviced: libafsauthent
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
tbutc: tviced
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
libadmin: tbutc
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
adminutil: libadmin
- $(CD) src\libadmin\$@
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
vos: adminutil
- $(CD) src\libadmin\$@
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
client: vos
- $(CD) src\libadmin\$@
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
kas: client
- $(CD) src\libadmin\$@
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
pts: kas
- $(CD) src\libadmin\$@
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
bos: pts
- $(CD) src\libadmin\$@
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
cfg: bos
- $(CD) src\libadmin\$@
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
admintest: cfg
- $(CD) src\libadmin\test
+ echo ***** $@
+ $(CD) $(OBJ)\libadmin\test
$(NTMAKE)
$(CD) ..\..\..
talocale: admintest
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
license: talocale
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
afsadmsvr: license
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
afsusrmgr: afsadmsvr
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
afssvrmgr: afsusrmgr
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
afssvrcfg: afssvrmgr
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
afssvrcpa: afssvrcfg
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
afs_setup_utils: afssvrcpa
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
client_talocale: afs_setup_utils
- $(CD) src\WINNT\talocale
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\talocale
$(NTMAKE)
$(CD) ..\..\..
client_osi: client_talocale
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
afsd: client_osi
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
client_cpa: afsd
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
client_config: client_cpa
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
client_exp: client_config
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
client_creds: client_exp
- $(CD) src\WINNT\$@
+ echo ***** $@
+ $(CD) $(OBJ)\WINNT\$@
$(NTMAKE)
$(CD) ..\..\..
finale: client_creds
- $(CD) src\$@
+ echo ***** $@
+ $(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
# InstallShield dependencies
InstallShield5: install
- $(CD) src\WINNT\install\$@
+ $(CD) $(OBJ)\WINNT\install\$@
$(NTMAKE)
$(CD) ..\..\..\..
-# Clean target for src tree
+# Clean target for obj tree
clean: start
nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" install
- $(CD) src\config
+ $(CD) $(OBJ)\config
nmake /nologo /f ntmakefile clean_version
$(CD) ..\..
--- /dev/null
+Copyright 2000, International Business Machines Corporation and others.
+All Rights Reserved.
+
+This software has been released under the terms of the IBM Public
+License. For details, see the LICENSE file in the top-level source
+directory or online at http://www.openafs.org/dl/license10.html
+
+Building Open AFS on Win 95
+---------------------------
+
+The Windows 95 Open AFS client consists of two main components: the client
+program afsd.exe, which is compiled with the DJGPP compiler and runs in a
+DOS virtual machine; and the utility programs, which are built on Windows
+NT or 9x using the Microsoft Visual C++ compiler V6.0.
+
+afsd.exe
+--------
+
+afsd.exe is built using the DJGPP cross-compiler, executed from Linux.
+It should also be possible to build it using the native DOS DJGPP compiler,
+but we did not try this. You will need to install the following packages
+from DJGPP and the Coda project.
+
+ftp://ftp.coda.cs.cmu.edu/pub/tools/djgpp-2.01_0.93_glibc-1.i386.rpm
+ftp://ftp.coda.cs.cmu.edu/pub/tools/djgpp-win95ext-2.01_0.93_glibc-1.i386.rpm
+ftp://ftp.coda.cs.cmu.edu/pub/tools/gdb-djgpp-4.16-2.i386.rpm
+
+You will also need the MMAP.VXD and SOCK.VXD from the Coda project. Source
+is available here:
+ftp://ftp.coda.cs.cmu.edu/pub/coda/src/win95-coda-5.2.0.zip
+
+Follow the Coda instructions to build these VXD's, which you can read here:
+http://www.coda.cs.cmu.edu/doc/html/coda-howto-6.html#ss6.4
+
+Once you have the necessary tools installed, set the following environment
+variables:
+SYS_NAME: set to i386_djgpp
+LINUX_SYS: set to the sysname of the Linux version you are using, e.g.,
+ i386_linux22
+
+The makefile expects to build into a platform directory with symlinks
+into the source directory. The Perl script "mkdest.pl" in this dir. will
+set this up for you. To use it, create a directory under the top-level
+dir. (the directory above src) called "i386_djgpp". Then cd to that
+directory and type "../src/mkdest.pl <absolute path of your src dir.>"
+
+Then execute "make -f Makefile.djgpp" from the top-level directory.
+(You can create a symlink to src/Makefile.djgpp from this dir.)
+The afsd.exe will be built into i386_djgpp/dest/bin.
+
+Build notes:
+
+ The Makefile.djgpp actually builds Linux versions of the utilities
+ rxgen, install, compile_et, and util.a. It uses the Linux version
+ of param.h which it copies to the afs subdirectory of the above
+ components. You will need to set SYS_NAME to your Linux system name
+ manually if you want to build these utilities separately.
+
+Utilities and GUI programs
+--------------------------
+
+The rest of the support programs are built as Win32 executables from a
+Windows 9x or NT system. You will need to set the following environment
+variables:
+
+set SYS_NAME=i386_win95
+set AFSDEV_BUILDTYPE=CHECKED (or FREE if you want to skip debugging info.)
+set AFSDEV_INCLUDE=<path of your Visual C include files>
+set AFSDEV_LIB=<path of your Visual C libs>
+set AFSDEV_BIN=.
+set AFSROOT=<PATH to base of development directory>
+ e.g. AFSROOT\SRC is source directory of the build tree
+SET _WIN32_IE=0x400
+set OBJ=src or obj, see below
+set MSSDK=<path to sdk header files>, see below
+
+If you are building on a Unix directory exported to Windows through Samba
+or AFS, you can create a platform directory named "i386_win95" using the
+"mkdest.pl" script as described above (run from a Unix system). This will
+only work on a file system that supports symbolic links. If you are using
+a platform directory, set the OBJ environment var. to "obj" and create
+a symlink "obj" in the top-level dir. that points to "i386_win95/obj".
+Otherwise, set OBJ to "src" to build the objects with the sources.
+
+The environment variable AFSROOT points to the parent of the AFS src
+directory. Executables will be built by default in AFSROOT\dest.
+
+Copy the file src\NTMake9x to the parent of the src directory. You only
+need to do this once. If you are building on a local drive, copy
+AFSROOT\src\symlink.bat to AFSROOT\.
+
+Follow the NT build instructions in file "README-NT" to perform the build.
+You will be using "NTMake9x" as the top-level makefile, instead of
+"NTMakefile". Most of the instructions in "README-NT" apply to the Win9x
+build as well.
+
+Build Notes:
+
+1) If you are building the Windows 9x AFS Client Control Panel
+ (win9xpanel), it requires shlwapi.h. This file can be found in the
+ header files associated with the Windows SDK (95/98 NT or W2000).
+
+2) You can build the Windows 9x client from a Windows NT or W2000 system.
+ This requires you to edit AFSROOT\config\NTMakefile.i386_win95.
+ Change line: DEL = $(AFSROOT)\src\rmbat
+ to: DEL = -del /q /f
+
+3) If you build the W2000 client, then switch to building the Windows 95
+ client (or vice versa), you should clean the previous build by either:
+ nmake -f ntmakefile clean
+or nmake -f ntmake9x clean
+
+4) When building the "comerr" component, the makefile now uses the
+ existing error_table_nt.c file (and touches it so it will be up to date
+ by default.) If you make changes to the lex or yacc source files and want
+ to rebuild error_table_nt.c, you can simply delete it and rerun make,
+ which will cause the file to be built using lex and yacc. Make sure
+ you have these utilities on your system.
+
+5) Required DLL's for redistribution
+
+ The AFS Control Panel for Win95/98 requires Microsoft DLL's that can
+ be installed using:
+ VC6RedistSetup_enu.exe
+ This is located at:
+ http://support.microsoft.com/support/kb/articles/Q259/4/03.ASP
+
+6) Installation
+
+ First, execute "nmake /f ntmake9x media" to copy all the client
+ executables and other files to DEST\WinInstall.
+
+ You can then install the client onto a target Windows 9x machine by
+ executing:
+ install.bat <source> <drive> <install dir.> <home cell> <cache size in 1K blocks>
+ For example,
+ install.bat DEST\WinInstall\ c: \afscli almaden.ibm.com 40000
+
+ If you do not wish to use the batch file, you can install the client
+ manually by performing the following steps.
+
+ 1. On the target machine, copy all the files from DEST\WinInstall to the
+ install location (usually c:\afscli).
+ 2. Add entries to the target's AUTOEXEC.BAT file as follows:
+ set AFSCONF=c:\afscli (replace with your install dir.)
+ path %path%;c:\afscli
+ 3. Copy the template.reg file to afscli.reg. Replace any references
+ to c: and afscli with your install location. Double click on the
+ afscli.reg file to add the registry entries to the target system.
+ 4. Create the following AFS configuration files in the install dir.:
+ - ThisCell:
+ containing the name of your home cell
+ - cache.info:
+ containing your cache configuration. For example,
+ to configure a cache of 40,000 1KB blocks with a disk cache
+ location of c:\afscache, you would enter in this file:
+ /afs:c:\afscache;40000
+ (The cache location has no effect unless you have enabled
+ the experimental disk cache support.)
+ - CellServDB:
+ the cell server database. You can get the latest version from AFS:
+ /afs/transarc.com/service/etc/CellServDB.export
+ 5. Reboot the target machine.
+ 6. You can now start the client by executing the program WinAfsLoad.exe
+ from the install directory.
--- /dev/null
+Win9x AFS Client: Technical Notes
+---------------------------------
+
+This file gives a technical overview of the Win9x AFS client and describes
+the main differences from the NT client.
+
+
+Overview
+--------
+
+The Windows 9x client is based on the Windows NT/2000 client. Like the
+NT client, it exports AFS through an SMB interface. Programs access AFS
+files by mounting AFS submounts as SMB shares and using the built-in
+Windows SMB client to communicate with the AFS client. The AFS client
+acts as an SMB server. It runs entirely at user level.
+
+DOS box implementation and VXD's
+--------------------------------
+
+The main program of the Win9x client, afsd.exe, is implemented as a
+32-bit DOS program. It is compiled using the DJGPP compiler and runs in
+a Windows 9x DOS virtual machine. This approach was necessary to avoid
+a well-known deadlock problem in Windows 9x when the kernel calls up
+to a user-level Win32 daemon: the original requesting program grabs the
+Win16Mutex before entering the kernel. The request is then passed up to
+the daemon, who attempts to service it using network or file I/O calls.
+These calls also attempt to obtain the Win16Mutex, which is still being
+held by the original requester, so there is a deadlock.
+
+To avoid this problem, the daemon runs in a DOS box. I/O calls from
+a DOS program do not attempt to obtain the Win16Mutex, so the deadlock
+is avoided. This approach was discovered by the Coda team at Carnegie
+Mellon University and used to implement a Win9x version of their client.
+The Win9x AFS client uses the same approach. It also uses the Coda team's
+SOCK.VXD which was written to provide network functions to a DOS program.
+Sockets functions which call SOCK.VXD were added to the DJGPP library.
+
+For more information about the Coda team's approach to this problem, see
+their paper from Usenix 1999:
+http://www.cs.cmu.edu/afs/cs/project/coda/Web/docdir/freenix99.pdf
+
+Note that the AFS client also requires the Coda team's MMAP.VXD. We are
+not actually calling this VXD, but afsd crashes if it is built without
+it (i.e., by building with dos-gcc -bw95 instead of -bmmap). Solutions to
+this problem welcomed..
+
+Netbios functions
+-----------------
+
+The Windows AFS clients communicate with user applications using the
+SMB protocol, as described above. SMB communication is done using the
+Netbios interface. In Win32, there is a built-in function Netbios()
+which accomplishes this. In a DOS program, however, this function is
+unavailable. However, Netbios functionality is available in the BIOS
+by calling interrupt 0x5c. The NCB (Netbios Control Block) and data
+buffer must be in conventional DOS memory, i.e., below 1 MB. This memory
+can only be accessed in DJGPP by using the DOS memory access functions:
+dosmemget(), dosmemput(), _farpeekX() and _farpokeX(). The Win9x client
+uses a separately-allocated DOS memory buffer and copies data to and from
+DOS memory for network communication.
+
+Functions were also added to LWP's iomgr.c to check for the completion
+of Netbios requests. The IOMGR now checks for NCB completion in addition
+to checking for timer expiration, signal delivery, and performing select()
+on file descriptors.
+
+See the new files: netbios95.c, dosutils95.c, and the various changes
+(marked by "#ifdef DJGPP") to smb.c in WINNT/afsd. Also see lwp/iomgr.c.
+
+Thread functions
+----------------
+
+Unlike the NT client which uses Win32 thread and locking functions,
+the Win9x client uses the LWP package from the AFS source distribution.
+An interface layer was added to allow NT and Win9x to make the same calls.
+For example, thrd_Create() is now used to create a thread. In NT, this
+is just a macro to the Win32 function CreateThread(). In Win9x, it is a
+function which calls the LWP function LWP_CreateProcess(). See the new
+files osithrd95.c, osithrd95.h, and osithrdnt.h in WINNT/client_osi.
+
+Configuration parameters
+------------------------
+
+In DJGPP, it is not feasible to access the system registry, which is
+where the NT client stores its configuration info. For the Win9x client,
+the Unix approach is followed instead: the local cell is in a file called
+"ThisCell", cache configuration is in a file called "cache.info", and
+the cell database is stored in "CellServDB" instead of "afsdcell.ini".
+Many parameters are passed via the command line to afsd.exe and are
+processed just like the Unix clients.
+
+See the new files afsd_init95.c and afsd95.c in WINNT/afsd.
+
+Authentication
+--------------
+
+In the functions SetToken() and GetToken(), the NT client sends and
+receives the session key using a separate RPC which should use encryption,
+rather than including the session key in the pioctl packet. The Win9x
+version avoids this RPC and puts the session key back into the pioctl.
+This should not be a security issue on Win9x since it is a single-user
+machine. (The pioctl packet will not be visible externally.) See files
+WINNT/afsd/cm_ioctl.c and auth/ktc_nt.c.
+
+Persistent (disk) caching
+-------------------------
+
+Disk caching support was added for the 9x client. This has barely been
+tested and is still very experimental! In addition, there are numerous
+performance issues. It relies on the fact that LWP is a non-preemptive
+threads package, so no locking is done to protect shared data structures.
+In addition, it uses synchronous I/O to read and write disk files. Since
+LWP is a user-level threads package, any calls to normal I/O system calls
+like read() or write() will block the entire process. One better approach
+would be to add support for local disk file descriptors to the select()
+call used by IOMGR, and then to use IOMGR_Select to enqueue I/O requests
+to the disk. Currently, the select() function supports only sockets.
+
+It should be fairly easy to adapt this code for the NT client. See the
+implementation in WINNT/afsd/cm_diskcache95.c. To enable this code,
+define DISKCACHE95 in WINNT/afsd/Makefile.djgpp.
+
+Utility programs
+----------------
+
+The utility programs, such as klog.exe and fs.exe, are Win32 programs and
+are built using the Microsoft compiler. Changes to the code for these
+files are marked by "#ifdef AFS_WIN95_ENV".
+
+GUI interface
+-------------
+
+The Win9x client does not use the NT configuration GUI programs in
+client_creds and client_cpa (Control Panel Applet.) It uses a separate
+GUI program called WinAfsLoad.exe in WINNT/win9xpanel. This program can
+start afsd.exe and keep track of submounts and token expiration.
+
+The Explorer shell extension, which allows right clicking on a file
+in Windows Explorer to get an AFS submenu, is supported in Win9x.
+See WINNT/client_exp.
+
+Integrated logon
+----------------
+
+Integrated logon is not supported in the 9x client.
+
+Known issues
+------------
+
+1) The Microsoft linker LINK386.exe causes a deadlock when attempting to
+create an executable on an AFS filesystem. Somehow, the linker appears
+to be preempting the entire machine so afsd.exe cannot run to service
+requests. Solutions to this problem eagerly sought! (This problem does
+not seem to occur with the Win9x Coda client.)
--- /dev/null
+#
+# Makefile.djgpp
+# make information for this directory
+# requires gmake
+#
+
+SOURCES = afsd95.c afsd_init95.c cm_access.c cm_aclent.c cm_buf.c \
+ cm_callback.c cm_cell.c cm_config.c cm_conn.c cm_daemon.c \
+ cm_dcache.c cm_dir.c cm_dnlc.c cm_ioctl.c cm_scache.c \
+ cm_server.c cm_user.c cm_utils.c cm_vnodeops.c cm_volume.c \
+ dosutils95.c largeint95.c netbios95.c smb.c smb_ioctl.c \
+ cm_diskcache95.c queue95.c afsmsg95.c smb3.c
+
+include ../../config/Makefile.djgpp.common
+
+# apply changes from common for this directory
+#
+# no changes for this directory
+
+# what this directory builds
+#
+TARGETS = afsd.exe
+all : $(TARGETS)
+install : $(DESTBIN)/afsd.exe #$(DESTBIN)/klog.exe
+#CFLAGS += -I../vxd_lib
+#CFLAGS += -DAFS_VXD
+CFLAGS += -DDOS_PKT_WHOLE
+
+INCFILES = \
+ $(DESTINC)/netbios95.h \
+ $(DESTINC)/largeint95.h \
+ $(DESTINC)/dosdefs95.h \
+ $(DESTINC)/afs/afsmsg95.h
+
+# hard-wired dependency information
+#
+REQUIRED_LIBS = $(DESTLIB)/liblwp.a $(DESTLIB)/libosi.a \
+ $(DESTLIB)/afs/libcmd.a $(DESTLIB)/afs/libafsint.a \
+ $(DESTLIB)/afs/libvldb.a $(DESTLIB)/librxkad.a \
+ $(DESTLIB)/librx.a $(DESTLIB)/librxstat.a
+
+
+afsd.exe : $(ALL_OBJS) $(REQUIRED_LIBS)
+
+includes: $(INCFILES)
+
+EXECUTABLES = afsd afsd.exe
+
+$(DESTLIB)/liblwp.a :
+ $(MAKE) -C ../lwp install
+
+$(DESTLIB)/librx.a :
+ $(MAKE) -C ../rx install
+
+$(DESTLIB)/libosi.a :
+ $(MAKE) -C ../client_osi install
+
+$(DESTLIB)/libcmd.a :
+ $(MAKE) -C ../../cmd install
+
+$(DESTLIB)/libafsint.a :
+ $(MAKE) -C ../../fsint install
+
+$(DESTLIB)/librxkad.a :
+ $(MAKE) -C ../../rxkad install
+
+$(DESTLIB)/libvldb.a :
+ $(MAKE) -C ../../vlserver install
$(INCFILEDIR)\smb3.h \
$(INCFILEDIR)\smb_iocons.h \
$(INCFILEDIR)\smb_ioctl.h \
+ $(INCFILEDIR)\afsmsg95.h \
$(INCFILEDIR)\afsrpc.h
IDLFILES =\
$(EXEDIR)\afsshare.exe \
$(DESTDIR)\bin\kpasswd.exe
+install9X: install_headers $(CONF_DLLFILE) \
+ $(EXEDIR)\klog.exe \
+ $(EXEDIR)\tokens.exe \
+ $(EXEDIR)\unlog.exe $(EXEDIR)\afsd_service.exe \
+ $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \
+ $(LOGON_DLLFILE) $(LOG95_DLLFILE) \
+ $(EXEDIR)\afsshare.exe \
+ $(DESTDIR)\bin\kpasswd.exe
+
+install_libutils: install_headers $(CONF_DLLFILE) \
+ $(EXEDIR)\klog.exe \
+ $(EXEDIR)\tokens.exe \
+ $(EXEDIR)\unlog.exe \
+ $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \
+ $(EXEDIR)\afsshare.exe \
+ $(DESTDIR)\bin\kpasswd.exe
+
############################################################################
# Local clean target; augments predefined clean target
-clean::
- $(DEL) *.res
-
############################################################################
# assorted exe's
afslog95.res: afslog95.rc AFS_component_version_number.h
libafsconf.res: libafsconf.rc AFS_component_version_number.h
+
+clean::
+ $(DEL) *.res
+ $(DEL) afsrpc.h
+ $(DEL) afsrpc_?.*
+ $(DEL) $(EXELIBS)
#ifndef __AFSD_H_ENV__
#define __AFSD_H_ENV__ 1
+#include <afs/param.h>
+
+#ifndef DJGPP
BOOL InitClass(HANDLE);
BOOL InitInstance(HANDLE, int);
LONG APIENTRY MainWndProc(HWND, unsigned int, unsigned int, long);
BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
+#endif /* !DJGPP */
+#ifndef DJGPP
#include <nb30.h>
+#else /* DJGPP */
+#include <sys/farptr.h>
+#include <go32.h>
+#include "dosdefs95.h"
+#include "largeint95.h"
+#endif /* !DJGPP */
+
#include "afsdicon.h"
#include "cm.h"
#include <crypt.h>
#include <afs/prs_fs.h>
-#include "cm_access.h"
+#include <osi.h>
+#include "cm_user.h"
+#include "cm_callback.h"
+#ifdef DISKCACHE95
+#include "cm_diskcache95.h"
+#endif /* DISKCACHE95 */
+#include "cm_conn.h"
#include "cm_aclent.h"
#include "cm_cell.h"
#include "cm_config.h"
#include "cm_server.h"
-#include "cm_user.h"
-#include "cm_conn.h"
#include "cm_volume.h"
-#include "cm_access.h"
#include "cm_scache.h"
#include "cm_dcache.h"
-#include "cm_buf.h"
-#include "cm_callback.h"
+#include "cm_access.h"
#include "cm_vnodeops.h"
#include "cm_dir.h"
#include "cm_utils.h"
#include "cm_daemon.h"
#include "cm_ioctl.h"
#include "cm_dnlc.h"
+#include "cm_buf.h"
+#ifdef DJGPP
+#include "afs/afsmsg95.h"
+#endif
#include <afs/vldbint.h>
#include <afs/afsint.h>
#define AFS_DAEMON_SERVICE_NAME "TransarcAFSDaemon"
#define AFS_DAEMON_EVENT_NAME "AFS Client"
+void afs_exit();
+
/* globals from the base afsd */
extern int cm_logChunkSize;
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#include <afs/param.h>
+#include <afs/stds.h>
+
+/*#include <windows.h>*/
+#include <string.h>
+/*#include <nb30.h>*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <osi.h>
+#include <signal.h>
+#include <afs/cmd.h>
+/*#include <winsock2.h>*/
+#include "afsd.h"
+#include "afsd_init.h"
+
+
+char main_statusText[100];
+osi_log_t *afsd_logp;
+
+extern int traceOnPanic;
+BOOL InitInstance(struct cmd_syndesc *as, char *arock);
+extern int afs_shutdown;
+int tried_shutdown=0;
+
+int afs_current_status = AFS_STATUS_INIT;
+
+/*
+ * Notifier function for use by osi_panic
+ */
+void afsd_notifier(char *msgp, char *filep, long line)
+{
+ char tbuffer[100];
+ if (filep)
+ sprintf(tbuffer, "Error at file %s, line %d", filep, line);
+ else
+ strcpy(tbuffer, "Error at unknown location");
+
+ if (!msgp)
+ msgp = "Assertion failure";
+
+ /*MessageBox(NULL, tbuffer, msgp, MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);*/
+
+ afsd_ForceTrace(TRUE);
+
+ if (traceOnPanic) {
+ /*asm("int 3");*/
+ }
+
+ afs_exit(AFS_EXITCODE_PANIC);
+}
+
+/* Init function called when window application starts. Inits instance and
+ * application together, since in Win32 they're essentially the same.
+ *
+ * Function then goes into a loop handling user interface messages. Most are
+ * used to handle redrawing the icon.
+ */
+int main(int argc, char *argv[])
+{
+ struct cmd_syndesc *ts;
+
+ fprintf(stderr, "AFS Client for Windows 95.\n");
+ /*fprintf(stderr, "Use Ctrl-C to shut down client.\n\n\n");*/
+ ts = cmd_CreateSyntax((char *) 0, (int (*)()) InitInstance, (char *) 0, "start AFS");
+ cmd_AddParm(ts, "-lanadapt", CMD_SINGLE, CMD_OPTIONAL, "LAN adapter number");
+ cmd_AddParm(ts, "-threads", CMD_SINGLE, CMD_OPTIONAL, "Number of server threads");
+ cmd_AddParm(ts, "-rootvol", CMD_SINGLE, CMD_OPTIONAL, "name of AFS root volume");
+ cmd_AddParm(ts, "-stat", CMD_SINGLE, CMD_OPTIONAL, "number of stat entries");
+ cmd_AddParm(ts, "-memcache", CMD_FLAG, CMD_OPTIONAL, "use memory cache");
+ cmd_AddParm(ts, "-cachedir", CMD_SINGLE, CMD_OPTIONAL, "cache directory");
+ cmd_AddParm(ts, "-mountdir", CMD_SINGLE, CMD_OPTIONAL, "mount location");
+ cmd_AddParm(ts, "-daemons", CMD_SINGLE, CMD_OPTIONAL, "number of daemons to use");
+ cmd_AddParm(ts, "-nosettime", CMD_FLAG, CMD_OPTIONAL, "don't set the time");
+ cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "display lots of information");
+ cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL, "display debug info");
+ cmd_AddParm(ts, "-chunksize", CMD_SINGLE, CMD_OPTIONAL, "log(2) of chunk size");
+ cmd_AddParm(ts, "-dcache", CMD_SINGLE, CMD_OPTIONAL, "number of dcache entries");
+ cmd_AddParm(ts, "-confdir", CMD_SINGLE, CMD_OPTIONAL, "configuration directory");
+ cmd_AddParm(ts, "-logfile", CMD_SINGLE, CMD_OPTIONAL, "Place to keep the CM log");
+ cmd_AddParm(ts, "-waitclose", CMD_FLAG, CMD_OPTIONAL, "make close calls synchronous");
+ cmd_AddParm(ts, "-shutdown", CMD_FLAG, CMD_OPTIONAL, "Shutdown all afs state");
+ cmd_AddParm(ts, "-sysname", CMD_SINGLE, CMD_OPTIONAL, "System name (@sys value)");
+ cmd_AddParm(ts, "-gateway", CMD_FLAG, CMD_OPTIONAL, "machine is a gateway");
+ cmd_AddParm(ts, "-tracebuf", CMD_SINGLE, CMD_OPTIONAL, "trace buffer size");
+ cmd_AddParm(ts, "-startup", CMD_FLAG, CMD_OPTIONAL, "start AFS client");
+ cmd_AddParm(ts, "-diskcache", CMD_SINGLE, CMD_OPTIONAL, "diskcache size");
+
+ return (cmd_Dispatch(argc, argv));
+}
+
+/* initialize the process. Reads the init files to get the appropriate
+ * information. */
+void vxd_Shutdown(void);
+int afsd_shutdown(int);
+int shutdown_handler(int);
+
+BOOL InitInstance(struct cmd_syndesc *as, char *arock)
+{
+ long code;
+ char *reason;
+
+#ifdef DJGPP
+ osi_Init();
+#endif
+
+#ifndef DJGPP
+ osi_InitPanic(afsd_notifier);
+#endif
+
+ /*sleep(10);*/
+
+ afsi_start();
+
+ code = afsMsg_Init();
+ if (code != 0)
+ osi_panic("socket failure", __FILE__, __LINE__);
+
+ code = afsd_InitCM(&reason, as, arock);
+ if (code != 0)
+ osi_panic(reason, __FILE__, __LINE__);
+
+ code = afsd_InitDaemons(&reason);
+ if (code != 0)
+ osi_panic(reason, __FILE__, __LINE__);
+
+ code = afsd_InitSMB(&reason);
+ if (code != 0)
+ osi_panic(reason, __FILE__, __LINE__);
+
+ signal(SIGINT, shutdown_handler);
+
+ thrd_Yield(); /* give new threads a chance to run */
+
+ /* send message to GUI caller indicating successful init */
+ afs_current_status = AFS_STATUS_RUNNING;
+ afsMsg_StatusChange(afs_current_status, 0, NULL);
+
+#ifdef DJGPP
+ /* Keep the process from just terminating */
+ while(afs_shutdown == 0)
+ {
+ /*IOMGR_Sleep(180);*/
+ IOMGR_Sleep(8);
+ /* workaround: WaitForKeystroke(nonzero num) calls
+ IOMGR_Select, though Win95 select works only on sockets */
+ /* so, we poll instead */
+ /*if (LWP_WaitForKeystroke(0))
+ break;*/
+ }
+ afsd_shutdown(0);
+#endif
+ afs_exit(0);
+
+ return (TRUE);
+}
+
+int shutdown_handler(int x)
+{
+ if (!tried_shutdown)
+ {
+ fprintf(stderr, "This program should not be shut down manually. It should "
+ "be shut down by the\nWindows AFS Client Control Center. Press Ctrl-C "
+ "again if you really want to do this.\n");
+ fflush(stderr);
+ tried_shutdown = 1;
+ }
+ else
+ {
+ fprintf(stderr, "Shutting down AFSD...\n");
+ fflush(stderr);
+ afs_shutdown = 1;
+ }
+}
+
+int afsd_shutdown(int x)
+{
+#ifdef AFS_VXD
+ vxd_Shutdown();
+#else
+ smb_Shutdown();
+#endif
+
+ fprintf(stderr, "AFSD shutdown complete.\n");
+ /*exit(0);*/
+}
+
+void afs_exit(int exitCode)
+{
+ afs_current_status = AFS_STATUS_EXITING;
+ afsMsg_StatusChange(afs_current_status,
+ exitCode, NULL);
+ afsMsg_Shutdown();
+ exit(exitCode);
+}
void afsi_start();
+#ifndef DJGPP
int afsd_InitCM(char **reasonP);
-int afsd_InitDaemons(char **reasonP);
int afsd_InitSMB(char **reasonP, void *aMBfunc);
+#else /* DJGPP */
+int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock);
+int afsd_InitSMB(char **reasonP);
+#endif /* !DJGPP */
+int afsd_InitDaemons(char **reasonP);
void afsd_ForceTrace(BOOL flush);
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#include <afs/param.h>
+#include <afs/stds.h>
+#include <afs/afs_args.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <stdarg.h>
+
+#include <osi.h>
+#include "afsd.h"
+#include <rx/rx.h>
+#include <rx/rx_null.h>
+#include <afs/cmd.h>
+#include <netdb.h>
+#include "cm_rpc.h"
+
+#define AFSDIR_CLIENT_ETC_DIRPATH "c:/"
+#define AFSLOGFILE "afs.log"
+#define CACHEINFOFILE "cache.info"
+
+extern int RXAFSCB_ExecuteRequest();
+extern int RXSTATS_ExecuteRequest();
+
+osi_log_t *afsd_logp;
+
+char cm_rootVolumeName[64];
+DWORD cm_rootVolumeNameLen;
+cm_volume_t *cm_rootVolumep = NULL;
+cm_cell_t *cm_rootCellp = NULL;
+cm_fid_t cm_rootFid;
+cm_scache_t *cm_rootSCachep;
+char cm_mountRoot[1024];
+DWORD cm_mountRootLen;
+int cm_logChunkSize;
+int cm_chunkSize;
+int afs_diskCacheChunks;
+char cm_cachePath[128];
+int cm_diskCacheEnabled = 0;
+
+int smb_UseV3;
+
+int LANadapter;
+int lanAdaptSet = 0;
+int rootVolSet = 0;
+int cacheSetTime = TRUE;
+int afsd_verbose = 0;
+int chunkSize;
+
+int numBkgD;
+int numSvThreads;
+
+int traceOnPanic = 0;
+
+int logReady = 0;
+
+char cm_HostName[200];
+long cm_HostAddr;
+
+/*char cm_CachePath[200];*/
+/*DWORD cm_CachePathLen;*/
+char cm_CacheInfoPath[1024];
+int cacheBlocks;
+int sawCacheSize=0, sawDiskCacheSize=0, sawMountRoot=0;
+int sawCacheBaseDir=0;
+char cm_AFSLogFile[200];
+int afsd_CloseSynch = 0;
+int afs_shutdown = 0;
+char cm_confDir[200];
+
+BOOL isGateway = FALSE;
+BOOL reportSessionStartups = FALSE;
+
+int afsd_debug;
+cm_initparams_v1 cm_initParams;
+
+/*
+ * AFSD Initialization Log
+ *
+ * This is distinct from the regular debug logging facility.
+ * Log items go directly to a file, not to an array in memory, so that even
+ * if AFSD crashes, the log can be inspected.
+ */
+
+FILE *afsi_file;
+
+void
+afsi_start()
+{
+ char wd[100];
+ char t[100], u[100];
+ int zilch;
+ int code;
+ time_t now;
+ char *p;
+
+ afsi_file = NULL;
+ /*code = GetWindowsDirectory(wd, sizeof(wd));
+ if (code == 0) return;*/
+ strcpy (wd, "C:");
+ strcat(wd, "\\afsd_init.log");
+ /*GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));*/
+ time (&now);
+ strcpy(t, asctime(localtime(&now)));
+ /*afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
+ CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);*/
+ /*afsi_file = open(wd, O_RDWR | O_CREAT | O_RSHARE);*/
+ afsi_file = fopen(wd, "wt");
+ setbuf(afsi_file, NULL);
+
+ /*GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, u, sizeof(u));*/
+ time (&now);
+ strcpy(u, asctime(localtime(&now)));
+ p = strchr(u, '\n'); if (p) *p = 0;
+ p = strchr(u, '\r'); if (p) *p = 0;
+ strcat(t, ": Create log file\n");
+ strcat(u, ": Created log file\n");
+ /*WriteFile(afsi_file, t, strlen(t), &zilch, NULL);
+ WriteFile(afsi_file, u, strlen(u), &zilch, NULL);*/
+ /*write(afsi_file, t, strlen(t));
+ write(afsi_file, u, strlen(u));*/
+ fputs(t, afsi_file);
+ fputs(u, afsi_file);
+}
+
+void
+afsi_log(char *pattern, ...)
+{
+ char s[100], t[100], u[100];
+ int zilch;
+ time_t now;
+ va_list ap;
+#ifndef DEBUG
+ return;
+#endif
+ va_start(ap, pattern);
+
+ vsprintf(s, pattern, ap);
+ /*GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));*/
+ time(&now);
+ strcpy(t, asctime(localtime(&now)));
+ sprintf(u, "%s: %s\n", t, s);
+ if (afsi_file != NULL)
+ /* fputs(u, stderr); */
+ fputs(u, afsi_file);
+ /*write(afsi_file, u, strlen(u));*/
+ /*WriteFile(afsi_file, u, strlen(u), &zilch, NULL);*/
+}
+
+/*
+ * Standard AFSD trace
+ */
+
+void afsd_ForceTrace(BOOL flush)
+{
+ FILE *handle;
+ int len;
+ char buf[100];
+
+ if (!logReady) return;
+
+ /*len = GetTempPath(99, buf);*/
+ /*strcpy(&buf[len], "/afsd.log");*/
+ strcpy(buf, "c:/afsd.log");
+ /*handle = CreateFile(buf, GENERIC_WRITE, FILE_SHARE_READ,
+ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);*/
+ /*handle = open(buf, O_RDWR | O_CREAT | O_RSHARE);*/
+ handle = fopen(buf, "wt");
+ if (handle == NULL) {
+ logReady = 0;
+ osi_panic("Cannot create log file", __FILE__, __LINE__);
+ }
+ osi_LogPrint(afsd_logp, handle);
+ if (flush)
+ fflush(handle);
+ /*FlushFileBuffers(handle);*/
+ /*CloseHandle(handle);*/
+ fclose(handle);
+}
+
+/*------------------------------------------------------------------------------
+ * ParseCacheInfoFile
+ *
+ * Description:
+ * Open the file containing the description of the workstation's AFS cache
+ * and pull out its contents. The format of this file is as follows:
+ *
+ * cm_mountRoot:cacheBaseDir:cacheBlocks
+ *
+ * Arguments:
+ * None.
+ *
+ * Returns:
+ * 0 if everything went well,
+ * 1 otherwise.
+ *
+ * Environment:
+ * Nothing interesting.
+ *
+ * Side Effects:
+ * Sets globals.
+ *---------------------------------------------------------------------------*/
+
+int ParseCacheInfoFile()
+{
+ static char rn[]="ParseCacheInfoFile"; /*This routine's name*/
+ FILE *cachefd; /*Descriptor for cache info file*/
+ int parseResult; /*Result of our fscanf()*/
+ int32 tCacheBlocks;
+ char tCacheBaseDir[1024], *tbd, tCacheMountDir[1024], *tmd;
+ /*char cacheBaseDir[1024]; /* cache in mem, this is ignored */
+
+ if (afsd_debug)
+ printf("%s: Opening cache info file '%s'...\n",
+ rn, cm_CacheInfoPath);
+
+ cachefd = fopen(cm_CacheInfoPath, "r");
+ if (!cachefd) {
+ printf("%s: Can't read cache info file '%s'\n",
+ rn, cm_CacheInfoPath);
+ return(1);
+ }
+
+ /*
+ * Parse the contents of the cache info file. All chars up to the first
+ * colon are the AFS mount directory, all chars to the next colon are the
+ * full path name of the workstation cache directory and all remaining chars
+ * represent the number of blocks in the cache.
+ */
+ tCacheMountDir[0] = tCacheBaseDir[0] = '\0';
+ parseResult = fscanf(cachefd,
+ "%1024[^;];%1024[^;];%d",
+ tCacheMountDir, tCacheBaseDir, &tCacheBlocks);
+
+ /*
+ * Regardless of how the parse went, we close the cache info file.
+ */
+ fclose(cachefd);
+
+ if (parseResult == EOF || parseResult < 3) {
+ printf("%s: Format error in cache info file!\n",
+ rn);
+ if (parseResult == EOF)
+ printf("\tEOF encountered before any field parsed.\n");
+ else
+ printf("\t%d out of 3 fields successfully parsed.\n",
+ parseResult);
+
+ printf("\tcm_mountRoot: '%s'\n\tcm_cachePath: '%s'\n\tcacheBlocks: %d\n",
+ cm_mountRoot, cm_cachePath, cacheBlocks);
+ return(1);
+ }
+
+ for (tmd = tCacheMountDir; *tmd == '\n' || *tmd == ' ' || *tmd == '\t'; tmd++) ;
+ for (tbd = tCacheBaseDir; *tbd == '\n' || *tbd == ' ' || *tbd == '\t'; tbd++) ;
+ /* now copy in the fields not explicitly overridden by cmd args */
+ if (!sawMountRoot)
+ {
+ strcpy(cm_mountRoot, tmd);
+ cm_mountRootLen = strlen(tmd);
+ }
+ if (!sawCacheBaseDir)
+ strcpy(cm_cachePath, tbd);
+ if (!sawCacheSize)
+ cacheBlocks = tCacheBlocks;
+
+ if (afsd_debug) {
+ printf("%s: Cache info file successfully parsed:\n",
+ rn);
+ printf("\tcm_mountRoot: '%s'\n\tcm_cachePath: '%s'\n\tcacheBlocks: %d\n",
+ tmd, tbd, tCacheBlocks);
+ }
+ /*printf("cm_cachePath: %s\n", cm_cachePath);*/
+
+ /*PartSizeOverflow(tbd, cacheBlocks);*/
+
+ return(0);
+}
+
+/*
+ * AFSD Initialization
+ */
+
+int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock)
+{
+ osi_uid_t debugID;
+ long cacheBlocks;
+ long cacheSize;
+ long logChunkSize;
+ long stats;
+ long traceBufSize;
+ long ltt, ltto;
+ char rootCellName[256];
+ struct rx_service *serverp;
+ static struct rx_securityClass *nullServerSecurityClassp;
+ struct hostent *thp;
+ char *msgBuf;
+ char buf[200];
+ DWORD dummyLen;
+ long code;
+ struct cmd_syndesc *ts;
+ char *afsconf_path;
+ long diskCacheSize;
+ /*WSADATA WSAjunk;
+
+ WSAStartup(0x0101, &WSAjunk);*/
+
+#ifndef DJGPP
+ /* setup osidebug server at RPC slot 1000 */
+ osi_LongToUID(1000, &debugID);
+ code = osi_InitDebug(&debugID);
+ afsi_log("osi_InitDebug code %d", code);
+// osi_LockTypeSetDefault("stat"); /* comment this out for speed *
+ if (code != 0) {
+ *reasonP = "unknown error";
+ return -1;
+ }
+#endif
+
+ /* who are we ? */
+ gethostname(cm_HostName, sizeof(cm_HostName));
+#ifdef DJGPP
+ /* For some reason, we may be getting space-padded hostnames.
+ If so, we take out the padding so that we can append -AFS later. */
+ {
+ char *space = strchr(cm_HostName,' ');
+ if (space) *space = '\0';
+ }
+#endif
+ afsi_log("gethostname %s", cm_HostName);
+ thp = gethostbyname(cm_HostName);
+ memcpy(&cm_HostAddr, thp->h_addr_list[0], 4);
+
+ /* seed random number generator */
+ srand(ntohl(cm_HostAddr));
+
+ /* Get configuration parameters from command line */
+
+ /* call atoi on the appropriate parsed results */
+
+ if (!as->parms[20].items) {
+ /* -startup */
+ fprintf(stderr, "Please do not run this program directly. Use the AFS Client Windows loader\nto start AFS.\n");
+ exit(1);
+ }
+
+ if (as->parms[0].items) {
+ /* -lanadapt */
+ LANadapter = atoi(as->parms[0].items->data);
+ lanAdaptSet = 1;
+ afsi_log("LAN adapter number %d", LANadapter);
+ }
+ else
+ {
+ LANadapter = 0;
+ afsi_log("Default LAN adapter number 0");
+ }
+
+ if (as->parms[1].items) {
+ /* -threads */
+ numSvThreads = atoi(as->parms[1].items->data);
+ afsi_log("%d server threads", numSvThreads);
+ }
+ else
+ {
+ numSvThreads = CM_CONFIGDEFAULT_SVTHREADS;
+ afsi_log("Defaulting to %d server threads", numSvThreads);
+ }
+
+ if (as->parms[2].items) {
+ /* -rootvol */
+ strcpy(cm_rootVolumeName, as->parms[2].items->data);
+ rootVolSet = 1;
+ afsi_log("Root volume %s", cm_rootVolumeName);
+ }
+ else
+ {
+ strcpy(cm_rootVolumeName, "root.afs");
+ afsi_log("Default root volume name root.afs");
+ }
+
+ if (as->parms[3].items) {
+ /* -stat */
+ stats = atoi(as->parms[3].items->data);
+ afsi_log("Status cache size %d", stats);
+ }
+ else
+ {
+ stats = CM_CONFIGDEFAULT_STATS;
+ afsi_log("Default status cache size %d", stats);
+ }
+
+ if (as->parms[4].items) {
+ /* -memcache */
+ /* no-op */
+ }
+
+ if (as->parms[5].items) {
+ /* -cachedir */
+ /* no-op; cache is in memory, not mapped file */
+ strcpy(cm_cachePath, as->parms[5].items->data);
+ sawCacheBaseDir = 1;
+ }
+
+ if (as->parms[6].items) {
+ /* -mountdir */
+ strcpy(cm_mountRoot, as->parms[6].items->data);
+ cm_mountRootLen = strlen(cm_mountRoot);
+ sawMountRoot = 1;
+ afsi_log("Mount root %s", cm_mountRoot);
+ }
+ else
+ {
+ strcpy(cm_mountRoot, "/afs");
+ cm_mountRootLen = 4;
+ /* Don't log */
+ }
+
+ if (as->parms[7].items) {
+ /* -daemons */
+ numBkgD = atoi(as->parms[7].items->data);
+ afsi_log("%d background daemons", numBkgD);
+ }
+ else
+ {
+ numBkgD = CM_CONFIGDEFAULT_DAEMONS;
+ afsi_log("Defaulting to %d background daemons", numBkgD);
+ }
+
+ if (as->parms[8].items) {
+ /* -nosettime */
+ cacheSetTime = FALSE;
+ }
+
+ if (as->parms[9].items) {
+ /* -verbose */
+ afsd_verbose = 1;
+ }
+
+ if (as->parms[10].items) {
+ /* -debug */
+ afsd_debug = 1;
+ afsd_verbose = 1;
+ }
+
+ if (as->parms[11].items) {
+ /* -chunksize */
+ chunkSize = atoi(as->parms[11].items->data);
+ if (chunkSize < 12 || chunkSize > 30) {
+ afsi_log("Invalid chunk size %d, using default",
+ logChunkSize);
+ logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE;
+ }
+ } else {
+ logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE;
+ afsi_log("Default chunk size %d", logChunkSize);
+ }
+ cm_logChunkSize = logChunkSize;
+ cm_chunkSize = 1 << logChunkSize;
+
+ if (as->parms[12].items) {
+ /* -dcache */
+ cacheSize = atoi(as->parms[12].items->data);
+ afsi_log("Cache size %d", cacheSize);
+ sawCacheSize = 1;
+ }
+ else
+ {
+ cacheSize = CM_CONFIGDEFAULT_CACHESIZE;
+ afsi_log("Default cache size %d", cacheSize);
+ }
+
+ afsconf_path = getenv("AFSCONF");
+ if (!afsconf_path)
+ strcpy(cm_confDir, AFSDIR_CLIENT_ETC_DIRPATH);
+ else
+ strcpy(cm_confDir, afsconf_path);
+ if (as->parms[13].items) {
+ /* -confdir */
+ strcpy(cm_confDir, as->parms[13].items->data);
+ }
+
+ sprintf(cm_CacheInfoPath, "%s/%s", cm_confDir, CACHEINFOFILE);
+
+ sprintf(cm_AFSLogFile, "%s/%s", cm_confDir, AFSLOGFILE);
+ if (as->parms[14].items) {
+ /* -logfile */
+ strcpy(cm_AFSLogFile, as->parms[14].items->data);
+ }
+
+ if (as->parms[15].items) {
+ /* -waitclose */
+ afsd_CloseSynch = 1;
+ }
+
+ if (as->parms[16].items) {
+ /* -shutdown */
+ afs_shutdown = 1;
+ /*
+ * Cold shutdown is the default
+ */
+ printf("afsd: Shutting down all afs processes and afs state\n");
+ /*call_syscall(AFSOP_SHUTDOWN, 1);*/
+ exit(0);
+ }
+
+ if (as->parms[17].items) {
+ /* -sysname */
+ strcpy(cm_sysName, as->parms[17].items->data);
+ }
+ else
+ strcpy(cm_sysName, "i386_win95");
+
+ if (as->parms[18].items) {
+ /* -gateway */
+ isGateway = 1;
+ afsi_log("Set for %s service",
+ isGateway ? "gateway" : "stand-alone");
+ }
+ else
+ isGateway = 0;
+
+ if (as->parms[19].items) {
+ /* -tracebuf */
+ traceBufSize = atoi(as->parms[19].items->data);
+ afsi_log("Trace Buffer size %d", traceBufSize);
+ }
+ else
+ {
+ traceBufSize = CM_CONFIGDEFAULT_TRACEBUFSIZE;
+ afsi_log("Default trace buffer size %d", traceBufSize);
+ }
+
+ if (as->parms[21].items) {
+ /* -diskcache */
+ diskCacheSize = atoi(as->parms[21].items->data);
+ cm_diskCacheEnabled = 1;
+ afsi_log("Disk cache size %d K", diskCacheSize);
+ /*printf("Disk cache size %d K", diskCacheSize);*/
+ sawDiskCacheSize = 1;
+ }
+ else
+ {
+ diskCacheSize = 50000; /*CM_CONFIGDEFAULT_DISKCACHESIZE;*/
+ afsi_log("Default disk cache size %d", diskCacheSize);
+ }
+
+ if (ParseCacheInfoFile()) {
+ exit(1);
+ }
+
+ /* setup early variables */
+ /* These both used to be configurable. */
+ smb_UseV3 = 1;
+ buf_bufferSize = CM_CONFIGDEFAULT_BLOCKSIZE;
+
+ /* turn from 1024 byte units into memory blocks */
+ cacheBlocks = (cacheSize * 1024) / buf_bufferSize;
+ afs_diskCacheChunks = (diskCacheSize * 1024) / buf_bufferSize;
+ /*printf("afs_diskCacheChunks=%d\n", afs_diskCacheChunks);*/
+
+ /*
+ * Save client configuration for GetCacheConfig requests
+ */
+ cm_initParams.nChunkFiles = 0;
+ cm_initParams.nStatCaches = stats;
+ cm_initParams.nDataCaches = 0;
+ cm_initParams.nVolumeCaches = 0;
+ cm_initParams.firstChunkSize = cm_chunkSize;
+ cm_initParams.otherChunkSize = cm_chunkSize;
+ cm_initParams.cacheSize = cacheSize;
+ cm_initParams.setTime = 0;
+ cm_initParams.memCache = 0;
+
+ /* setup and enable debug log */
+ afsd_logp = osi_LogCreate("afsd", traceBufSize);
+ afsi_log("osi_LogCreate log addr %x", afsd_logp);
+ osi_LogEnable(afsd_logp);
+ logReady = 1;
+
+#if 0
+ /* get network related info */
+ cm_noIPAddr = CM_MAXINTERFACE_ADDR;
+ code = syscfg_GetIFInfo(&cm_noIPAddr,
+ cm_IPAddr, cm_SubnetMask,
+ cm_NetMtu, cm_NetFlags);
+
+ if ( (cm_noIPAddr <= 0) || (code <= 0 ) )
+ afsi_log("syscfg_GetIFInfo error code %d", code);
+ else
+ afsi_log("First Network address %x SubnetMask %x",
+ cm_IPAddr[0], cm_SubnetMask[0]);
+#endif
+
+ /* initialize RX, and tell it to listen to port 7001, which is used for
+ * callback RPC messages.
+ */
+ code = rx_Init(htons(7001));
+ afsi_log("rx_Init code %x", code);
+ if (code != 0) {
+ *reasonP = "afsd: failed to init rx client on port 7001";
+ return -1;
+ }
+
+ /* Initialize the RPC server for session keys */
+ /*RpcInit();*/
+
+ /* create an unauthenticated service #1 for callbacks */
+ nullServerSecurityClassp = rxnull_NewServerSecurityObject();
+ serverp = rx_NewService(0, 1, "AFS", &nullServerSecurityClassp, 1,
+ RXAFSCB_ExecuteRequest);
+ afsi_log("rx_NewService addr %x", serverp);
+ if (serverp == NULL) {
+ *reasonP = "unknown error";
+ return -1;
+ }
+
+ nullServerSecurityClassp = rxnull_NewServerSecurityObject();
+ serverp = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats",
+ &nullServerSecurityClassp, 1, RXSTATS_ExecuteRequest);
+ afsi_log("rx_NewService addr %x", serverp);
+ if (serverp == NULL) {
+ *reasonP = "unknown error";
+ return -1;
+ }
+
+ /* start server threads, *not* donating this one to the pool */
+ rx_StartServer(0);
+ afsi_log("rx_StartServer");
+
+ /* init user daemon, and other packages */
+ cm_InitUser();
+
+ cm_InitACLCache(2*stats);
+
+ cm_InitConn();
+
+ cm_InitCell();
+
+ cm_InitServer();
+
+ cm_InitVolume();
+
+ cm_InitIoctl();
+
+ smb_InitIoctl();
+
+ cm_InitCallback();
+
+ cm_InitSCache(stats);
+
+ code = cm_InitDCache(0, cacheBlocks);
+
+ afsi_log("cm_InitDCache code %x", code);
+ if (code != 0) {
+ *reasonP = "error initializing cache";
+ return -1;
+ }
+
+ code = cm_GetRootCellName(rootCellName);
+ afsi_log("cm_GetRootCellName code %d rcn %s", code,
+ (code ? "<none>" : rootCellName));
+ if (code != 0) {
+ *reasonP = "can't find root cell name in ThisCell";
+ return -1;
+ }
+
+ cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE);
+ afsi_log("cm_GetCell addr %x", cm_rootCellp);
+ if (cm_rootCellp == NULL) {
+ *reasonP = "can't find root cell in CellServDB";
+ return -1;
+ }
+
+ return 0;
+}
+
+int afsd_InitDaemons(char **reasonP)
+{
+ long code;
+ cm_req_t req;
+
+ cm_InitReq(&req);
+
+ /* this should really be in an init daemon from here on down */
+
+ code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp, &req, CM_FLAG_CREATE, &cm_rootVolumep);
+ afsi_log("cm_GetVolumeByName code %x root vol %x", code,
+ (code ? 0xffffffff : cm_rootVolumep));
+ if (code != 0) {
+ *reasonP = "can't find root volume in root cell";
+ return -1;
+ }
+
+ /* compute the root fid */
+ cm_rootFid.cell = cm_rootCellp->cellID;
+ cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
+ cm_rootFid.vnode = 1;
+ cm_rootFid.unique = 1;
+
+ code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req);
+ afsi_log("cm_GetSCache code %x scache %x", code,
+ (code ? 0xffffffff : cm_rootSCachep));
+ if (code != 0) {
+ *reasonP = "unknown error";
+ return -1;
+ }
+
+ cm_InitDaemon(numBkgD);
+ afsi_log("cm_InitDaemon");
+
+ return 0;
+}
+
+int afsd_InitSMB(char **reasonP)
+{
+ char hostName[200];
+ char *ctemp;
+
+ /* Do this last so that we don't handle requests before init is done.
+ * Here we initialize the SMB listener.
+ */
+ strcpy(hostName, cm_HostName);
+ ctemp = strchr(hostName, '.'); /* turn ntdfs.* into ntdfs */
+ if (ctemp) *ctemp = 0;
+ hostName[11] = 0; /* ensure that even after adding the -A, we
+ * leave one byte free for the netbios server
+ * type.
+ */
+ strcat(hostName, "-AFS");
+ strupr(hostName);
+ smb_Init(afsd_logp, hostName, smb_UseV3, LANadapter, numSvThreads);
+ afsi_log("smb_Init");
+
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* This file contains functions used by the Windows 95 (DJGPP) AFS client
+ to communicate with the startup executable. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include "afs/afsmsg95.h"
+
+int sock;
+struct sockaddr_in addr;
+extern int errno;
+
+int afsMsg_Init()
+{
+ int rc;
+ struct sockaddr_in myaddr;
+
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock < 0)
+ return -1;
+
+ addr.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(AFS_MSG_PORT);
+
+ myaddr.sin_addr.s_addr = INADDR_ANY;
+ myaddr.sin_family = AF_INET;
+ myaddr.sin_port = 0;
+
+ rc = bind(sock, (struct sockaddr *) &myaddr, sizeof(myaddr));
+#ifdef DEBUG
+ fprintf(stderr, "afsMsg_Init: bind sock %d rc=%d\n", sock, rc);
+#endif
+
+ return 0;
+}
+
+int afsMsg_StatusChange(int status, int exitCode, char *string)
+{
+ afsMsg_statChange_t *msgP;
+ int rc;
+ int slen = 0;
+ char msgBuf[AFS_MAX_MSG_LEN];
+ int now;
+
+ msgP = (afsMsg_statChange_t *) msgBuf;
+
+ msgP->hdr.msgtype = AFS_MSG_STATUS_CHANGE;
+
+ msgP->newStatus = status;
+ msgP->exitCode = exitCode;
+
+ if (string)
+ {
+ slen = strlen(string); /* one extra for NULL */
+ if (slen > AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t))
+ slen = AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t);
+ strncpy(&msgP->message, string, slen);
+ }
+
+ msgP->hdr.length = sizeof(afsMsg_statChange_t) + slen;
+
+ rc = sendto(sock, msgP, msgP->hdr.length, 0, (struct sockaddr *) &addr,
+ sizeof(addr));
+ /*rc = send(sock, &msg, msg.hdr.length, 0);*/
+ time(&now);
+#ifdef DEBUG
+ fprintf(stderr, "%s: sent status change %d to sock %d length %d size=%d errno=%d\n",
+ asctime(localtime(&now)), status,
+ sock, msgP->hdr.length, rc, (rc < 0 ? errno:0));
+#endif
+ fflush(stdout);
+
+ return rc;
+}
+
+int afsMsg_Print(char *str, int level)
+{
+ afsMsg_print_t *msgP;
+ int rc;
+ char msgBuf[AFS_MAX_MSG_LEN];
+ int slen;
+
+ slen = strlen(str); /* one extra for NULL */
+ if (slen > AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t))
+ slen = AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t);
+ strncpy(&msgP->message, str, slen);
+
+ msgP->hdr.msgtype = AFS_MSG_PRINT;
+ msgP->hdr.length = sizeof(afsMsg_hdr_t) + slen;
+ msgP->debugLevel = level;
+ strcpy(&msgP->message, str);
+
+ rc = sendto(sock, msgP, msgP->hdr.length, 0, (struct sockaddr *) &addr,
+ sizeof(addr));
+ return rc;
+}
+
+int afsMsg_Shutdown()
+{
+ int rc;
+ rc = close(sock);
+ if (rc < 0) fprintf(stderr, "error closing socket, rc=%d\n", rc);
+#ifdef DEBUG
+ else fprintf(stderr, "socket closed\n");
+#endif
+ fflush(stderr);
+}
--- /dev/null
+#ifndef _AFSMSG_H
+#define _AFSMSG_H
+
+#define AFS_MSG_PORT 2020
+
+#define AFS_MAX_MSG_LEN 512
+
+typedef struct _afsMsg_hdr {
+ int msgtype;
+ int length;
+} afsMsg_hdr_t;
+
+#define AFS_MSG_STATUS_CHANGE 1
+#define AFS_MSG_PRINT 2
+
+typedef struct _afsMsg_statChange {
+ afsMsg_hdr_t hdr;
+ int oldStatus;
+ int newStatus;
+ int exitCode;
+ char message;
+} afsMsg_statChange_t;
+
+#define AFS_STATUS_NOSTATUS -1
+#define AFS_STATUS_INIT 1
+#define AFS_STATUS_RUNNING 2
+#define AFS_STATUS_EXITING 3
+
+#define AFS_EXITCODE_NORMAL 0
+#define AFS_EXITCODE_PANIC 2
+#define AFS_EXITCODE_NETWORK_FAILURE 3
+#define AFS_EXITCODE_GENERAL_FAILURE 100
+
+typedef struct _afsMsg_print {
+ afsMsg_hdr_t hdr;
+ int debugLevel;
+ char message;
+} afsMsg_print_t;
+
+#endif
--- /dev/null
+#ifndef AFSRPC_H
+#define AFSRPC_H
+
+/* Copied from declaration of GUID in RPCDCE.H */
+typedef struct afs_uuid {
+ unsigned long Data1;
+ unsigned short Data2;
+ unsigned short Data3;
+ unsigned char Data4[8];
+} afs_uuid_t;
+
+long AFSRPC_SetToken(
+ afs_uuid_t uuid,
+ unsigned char sessionKey[8]
+);
+
+long AFSRPC_GetToken(
+ afs_uuid_t uuid,
+ unsigned char sessionKey[8]
+);
+
+#endif
#define __CM_H_ENV__ 1
#include <rx/rx.h>
+#ifdef DJGPP /* we need these for vldbentry decl., etc. */
+#include <afs/vldbint.h>
+#include <afs/afsint.h>
+#endif /* DJGPP */
/* from .xg file */
long VL_GetEntryByID(struct rx_connection *, long, long, struct vldbentry *);
struct AFSCallBack *CallBack,
struct AFSVolSync *Sync);
-StartRXAFS_StoreData (struct rx_call *,
+int StartRXAFS_StoreData (struct rx_call *,
struct AFSFid *Fid,
struct AFSStoreStatus *InStatus,
afs_int32 Pos,
afs_int32 Length,
afs_int32 FileLength);
-EndRXAFS_StoreData(struct rx_call *,
+int EndRXAFS_StoreData(struct rx_call *,
struct AFSFetchStatus *OutStatus,
struct AFSVolSync *Sync);
-RXAFS_StoreACL (struct rx_connection *,
+int RXAFS_StoreACL (struct rx_connection *,
struct AFSFid *Fid,
struct AFSOpaque *AccessList,
struct AFSFetchStatus *OutStatus,
struct AFSVolSync *Sync);
-RXAFS_StoreStatus(struct rx_connection *,
+int RXAFS_StoreStatus(struct rx_connection *,
struct AFSFid *Fid,
struct AFSStoreStatus *InStatus,
struct AFSFetchStatus *OutStatus,
struct AFSVolSync *Sync);
-RXAFS_RemoveFile (struct rx_connection *,
+int RXAFS_RemoveFile (struct rx_connection *,
struct AFSFid *DirFid,
char *namep,
struct AFSFetchStatus *OutStatus,
struct AFSVolSync *Sync);
-RXAFS_CreateFile (struct rx_connection *,
+int RXAFS_CreateFile (struct rx_connection *,
struct AFSFid *DirFid,
char *Name,
struct AFSStoreStatus *InStatus,
struct AFSCallBack *CallBack,
struct AFSVolSync *Sync);
-RXAFS_Rename (struct rx_connection *,
+int RXAFS_Rename (struct rx_connection *,
struct AFSFid *OldDirFid,
char *OldName,
struct AFSFid *NewDirFid,
struct AFSFetchStatus *OutNewDirStatus,
struct AFSVolSync *Sync);
-RXAFS_Symlink (struct rx_connection *,
+int RXAFS_Symlink (struct rx_connection *,
struct AFSFid *DirFid,
char *name,
char *LinkContents,
struct AFSFetchStatus *OutDirStatus,
struct AFSVolSync *Sync);
-RXAFS_Link (struct rx_connection *,
+int RXAFS_Link (struct rx_connection *,
struct AFSFid *DirFid,
char *Name,
struct AFSFid *ExistingFid,
struct AFSFetchStatus *OutDirStatus,
struct AFSVolSync *Sync);
-RXAFS_MakeDir (struct rx_connection *,
+int RXAFS_MakeDir (struct rx_connection *,
struct AFSFid *DirFid,
char *name,
struct AFSStoreStatus *InStatus,
struct AFSCallBack *CallBack,
struct AFSVolSync *Sync);
-RXAFS_RemoveDir (struct rx_connection *,
+int RXAFS_RemoveDir (struct rx_connection *,
struct AFSFid *DirFid,
char *Name,
struct AFSFetchStatus *OutDirStatus,
struct AFSVolSync *Sync);
-RXAFS_GetStatistics (struct rx_connection *,
+int RXAFS_GetStatistics (struct rx_connection *,
struct ViceStatistics *Statistics);
-RXAFS_GiveUpCallBacks (struct rx_connection *,
+int RXAFS_GiveUpCallBacks (struct rx_connection *,
struct AFSCBFids *Fids_Array,
struct AFSCBs *CallBacks_Array);
-RXAFS_GetVolumeInfo (struct rx_connection *,
+int RXAFS_GetVolumeInfo (struct rx_connection *,
char *VolumeName,
struct VolumeInfo *Volumeinfo);
-RXAFS_GetVolumeStatus (struct rx_connection *,
+int RXAFS_GetVolumeStatus (struct rx_connection *,
afs_int32 Volumeid,
struct AFSFetchVolumeStatus *Volumestatus,
char **name,
char **offlineMsg,
char **motd);
-RXAFS_SetVolumeStatus (struct rx_connection *,
+int RXAFS_SetVolumeStatus (struct rx_connection *,
afs_int32 Volumeid,
struct AFSStoreVolumeStatus *Volumestatus,
char *name,
char *olm,
char *motd);
-RXAFS_GetRootVolume (struct rx_connection *,
+int RXAFS_GetRootVolume (struct rx_connection *,
char **VolumeName);
-RXAFS_CheckToken (struct rx_connection *,
+int RXAFS_CheckToken (struct rx_connection *,
afs_int32 ViceId,
struct AFSOpaque *token);
-RXAFS_GetTime (struct rx_connection *,
+int RXAFS_GetTime (struct rx_connection *,
afs_uint32 *Seconds,
afs_uint32 *USeconds);
-RXAFS_BulkStatus (struct rx_connection *,
+int RXAFS_BulkStatus (struct rx_connection *,
struct AFSCBFids *FidsArray,
struct AFSBulkStats *StatArray,
struct AFSCBs *CBArray,
struct AFSVolSync *Sync);
-RXAFS_SetLock (struct rx_connection *,
+int RXAFS_SetLock (struct rx_connection *,
struct AFSFid *Fid,
int Type,
struct AFSVolSync *Sync);
-RXAFS_ExtendLock (struct rx_connection *,
+int RXAFS_ExtendLock (struct rx_connection *,
struct AFSFid *Fid,
struct AFSVolSync *Sync);
-RXAFS_ReleaseLock (struct rx_connection *,
+int RXAFS_ReleaseLock (struct rx_connection *,
struct AFSFid *Fid,
struct AFSVolSync *Sync);
/* This interface is to supported the AFS/DFS Protocol Translator */
-RXAFS_Lookup (struct rx_connection *,
+int RXAFS_Lookup (struct rx_connection *,
struct AFSFid *DirFid,
char *Name,
struct AFSFid *OutFid,
#define CM_ERROR_NOIPC (CM_ERROR_BASE+36)
#define CM_ERROR_BADNTFILENAME (CM_ERROR_BASE+37)
#define CM_ERROR_BUFFERTOOSMALL (CM_ERROR_BASE+38)
+#define CM_ERROR_RENAME_IDENTICAL (CM_ERROR_BASE+39)
#endif /* __CM_H_ENV__ */
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#endif
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
+#ifndef DJGPP
#include <nb30.h>
+#endif
#include <osi.h>
#include "afsd.h"
#ifndef _CM_ACCESS_H_ENV__
#define _CM_ACCESS_H_ENV__ 1
+#include "cm_user.h"
+
extern int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *up,
long rights, long *outRights);
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif
#include <osi.h>
#include <malloc.h>
#include <stdio.h>
long buf_bufferSize = CM_BUF_SIZE;
long buf_hashSize = CM_BUF_HASHSIZE;
+#ifndef DJGPP
static
HANDLE CacheHandle;
static
SYSTEM_INFO sysInfo;
+#endif /* !DJGPP */
/* buffer reservation variables */
long buf_reservedBufs;
/* another hash table */
cm_buf_t **buf_fileHashTablepp;
+#ifdef DISKCACHE95
+/* for experimental disk caching support in Win95 client */
+cm_buf_t *buf_diskFreeListp;
+cm_buf_t *buf_diskFreeListEndp;
+cm_buf_t *buf_diskAllp;
+extern int cm_diskCacheEnabled;
+#endif /* DISKCACHE95 */
+
/* hold a reference to an already held buffer */
void buf_Hold(cm_buf_t *bp)
{
lock_ReleaseWrite(&buf_globalLock);
nAtOnce = buf_nbuffers / 10;
while (1) {
- i = SleepEx(5000, 1);
+#ifndef DJGPP
+ i = SleepEx(5000, 1);
if (i != 0) continue;
+#else
+ thrd_Sleep(5000);
+#endif /* DJGPP */
/* now go through our percentage of the buffers */
for(i=0; i<nAtOnce; i++) {
} /* whole daemon's while loop */
}
+#ifndef DJGPP
/* Create a security attribute structure suitable for use when the cache file
* is created. What we mainly want is that only the administrator should be
* able to do anything with the file. We create an ACL with only one entry,
return psa;
}
+#endif /* !DJGPP */
+#ifndef DJGPP
/* Free a security attribute structure created by CreateCacheFileSA() */
VOID FreeCacheFileSA(PSECURITY_ATTRIBUTES psa)
{
GlobalFree(psa->lpSecurityDescriptor);
GlobalFree(psa);
}
+#endif /* !DJGPP */
/* initialize the buffer package; called with no locks
* held during the initialization phase.
static osi_once_t once;
cm_buf_t *bp;
long sectorSize;
- HANDLE phandle;
+ thread_t phandle;
+#ifndef DJGPP
+ HANDLE hf, hm;
+ PSECURITY_ATTRIBUTES psa;
+#endif /* !DJGPP */
long i;
unsigned long pid;
- HANDLE hf, hm;
char *data;
- PSECURITY_ATTRIBUTES psa;
long cs;
+#ifndef DJGPP
/* Get system info; all we really want is the allocation granularity */
GetSystemInfo(&sysInfo);
+#endif /* !DJGPP */
/* Have to be able to reserve a whole chunk */
if (((buf_nbuffers - 3) * buf_bufferSize) < cm_chunkSize)
/* initialize global locks */
lock_InitializeRWLock(&buf_globalLock, "Global buffer lock");
+#ifndef DJGPP
/*
* Cache file mapping constrained by
* system allocation granularity;
afsi_log("Cache size rounded up to %d buffers",
buf_nbuffers);
}
+#endif /* !DJGPP */
/* remember this for those who want to reset it */
buf_nOrigBuffers = buf_nbuffers;
/* min value for which this works */
sectorSize = 1;
+#ifndef DJGPP
/* Reserve buffer space by mapping cache file */
psa = CreateCacheFileSA();
hf = CreateFile(cm_CachePath,
return CM_ERROR_INVAL;
}
CloseHandle(hm);
+#else
+ /* djgpp doesn't support memory mapped files */
+ data = malloc(buf_nbuffers * buf_bufferSize);
+#endif /* !DJGPP */
/* create buffer headers and put in free list */
bp = malloc(buf_nbuffers * sizeof(cm_buf_t));
osi_EndOnce(&once);
/* and create the incr-syncer */
- phandle = CreateThread((SECURITY_ATTRIBUTES *) 0, 0,
- (LPTHREAD_START_ROUTINE) buf_IncrSyncer, 0, 0, &pid);
+ phandle = thrd_Create(0, 0,
+ (ThreadFunc) buf_IncrSyncer, 0, 0, &pid,
+ "buf_IncrSyncer");
+
osi_assertx(phandle != NULL, "buf: can't create incremental sync proc");
+#ifndef DJGPP
CloseHandle(phandle);
+#endif /* !DJGPP */
}
return 0;
cm_buf_t *bp;
int i;
char *data;
+#ifndef DJGPP
HANDLE hm;
long cs;
return CM_ERROR_INVAL;
}
CloseHandle(hm);
+#else
+ data = malloc(buf_nbuffers * buf_bufferSize);
+#endif /* DJGPP */
/* Create buffer headers and put in free list */
bp = malloc(nbuffers * sizeof(*bp));
lock_ObtainMutex(&bp->mx);
if (code) break;
+
+#ifdef DISKCACHE95
+ /* Disk cache support */
+ /* write buffer to disk cache (synchronous for now) */
+ diskcache_Update(bp->dcp, bp->datap, buf_bufferSize, bp->dataVersion);
+#endif /* DISKCACHE95 */
};
/* do logging after call to GetLastError, or else */
osi_hyper_t pageOffset;
unsigned long tcount;
int created;
+#ifdef DISKCACHE95
+ cm_diskcache_t *dcp;
+#endif /* DISKCACHE95 */
created = 0;
pageOffset.HighPart = offsetp->HighPart;
/* lock it and break out */
lock_ObtainMutex(&bp->mx);
break;
+
+#ifdef DISKCACHE95
+ /* touch disk chunk to update LRU info */
+ diskcache_Touch(bp->dcp);
+#endif /* DISKCACHE95 */
}
/* otherwise, we have to create a page */
osi_assert(!(bp->flags & (CM_BUF_READING | CM_BUF_WRITING)));
/* setup offset, event */
+#ifndef DJGPP /* doesn't seem to be used */
bp->over.Offset = bp->offset.LowPart;
bp->over.OffsetHigh = bp->offset.HighPart;
+#endif /* !DJGPP */
/* start the I/O; may drop lock */
bp->flags |= CM_BUF_READING;
code = (*cm_buf_opsp->Readp)(bp, buf_bufferSize, &tcount, NULL);
+
+#ifdef DISKCACHE95
+ code = diskcache_Get(&bp->fid, &bp->offset, bp->datap, buf_bufferSize, &bp->dataVersion, &tcount, &dcp);
+ bp->dcp = dcp; /* pointer to disk cache struct. */
+#endif /* DISKCACHE95 */
+
if (code != 0) {
/* failure or queued */
+#ifndef DJGPP /* cm_bufRead always returns 0 */
if (code != ERROR_IO_PENDING) {
+#endif
bp->error = code;
bp->flags |= CM_BUF_ERROR;
bp->flags &= ~CM_BUF_READING;
lock_ReleaseMutex(&bp->mx);
buf_Release(bp);
return code;
+#ifndef DJGPP
}
+#endif
} else {
/* otherwise, I/O completed instantly and we're done, except
* for padding the xfr out with 0s and checking for EOF
#define _BUF_H__ENV_ 1
#include <osi.h>
+#ifdef DISKCACHE95
+#include "cm_diskcache.h"
+#endif /* DISKCACHE95 */
/* default # of buffers if not changed */
#define CM_BUF_BUFFERS 100
char *datap; /* data in this buffer */
unsigned long error; /* last error code, if CM_BUF_ERROR is set */
struct cm_user *userp; /* user who wrote to the buffer last */
+#ifndef DJGPP
OVERLAPPED over; /* overlapped structure for I/O */
+#endif
/* fields added for the CM; locked by scp->mx */
long dataVersion; /* data version of this page */
long cmFlags; /* flags for cm */
+#ifdef DISKCACHE95
+ cm_diskcache_t *dcp; /* diskcache structure */
+#endif /* DISKCACHE95 */
} cm_buf_t;
/* values for cmFlags */
extern cm_buf_t *buf_Find(struct cm_scache *, osi_hyper_t *);
+#ifndef DJGPP
extern HANDLE buf_GetFileHandle(long);
+#endif /* !DJGPP */
extern void buf_LockedCleanAsync(cm_buf_t *, cm_req_t *);
#include <afs/afs_args.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#define _CM_CALLBACK_H_ENV__ 1
#include <osi.h>
-#include "cm_scache.h"
typedef struct cm_callbackRequest {
long callbackCount; /* callback count at start of the request */
struct cm_server *serverp; /* server we really got the callback from */
} cm_callbackRequest_t;
+#include "cm_scache.h"
+
typedef struct cm_racingRevokes {
osi_queue_t q; /* queue for forward/backward searches */
cm_fid_t fid; /* fid revoked */
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <nb30.h>
#include <winsock2.h>
+#endif /* !DJGPP */
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netdb.h>
+#endif /* !DJGPP */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
char AFSConfigKeyName[] =
"SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
+#define AFS_THISCELL "ThisCell"
+#define AFS_CELLSERVDB_UNIX "CellServDB"
+#define AFS_CELLSERVDB_NT "afsdcell.ini"
+#define AFSDIR_CLIENT_ETC_DIRPATH "c:/afs"
+#if defined(DJGPP) || defined(AFS_WIN95_ENV)
+#define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX
+#ifdef DJGPP
+extern char cm_confDir[];
+extern int errno;
+#endif /* DJGPP */
+#else
+#define AFS_CELLSERVDB AFS_CELLSERVDB_NT
+#endif /* DJGPP || WIN95 */
+
+
static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp)
{
char *tp;
int foundCell;
long code;
int tracking = 1, partial = 0;
+ long ip_addr;
+#if defined(DJGPP) || defined(AFS_WIN95_ENV)
+ int c1, c2, c3, c4;
+ char aname[256];
+#endif
+ char *afsconf_path;
foundCell = 0;
+#if !defined(DJGPP)
code = GetWindowsDirectory(wdir, sizeof(wdir));
if (code == 0 || code > sizeof(wdir)) return -1;
-
+
/* add trailing backslash, if required */
tlen = strlen(wdir);
if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
-
- strcat(wdir, "afsdcell.ini");
+#else
+ strcpy(wdir, cm_confDir);
+ strcat(wdir,"/");
+#endif /* !DJGPP */
+ strcat(wdir, AFS_CELLSERVDB);
+
tfilep = fopen(wdir, "r");
- if (!tfilep) return -2;
+
+ if (!tfilep) {
+ /* If we are using DJGPP client, cellservdb will be in afsconf dir. */
+ /* If we are in Win95 here, we are linking with klog etc. and are
+ using DJGPP client even though DJGPP is not defined. So we still
+ need to check AFSCONF for location. */
+ afsconf_path = getenv("AFSCONF");
+ if (!afsconf_path)
+ strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
+ else
+ strcpy(wdir, afsconf_path);
+ strcat(wdir, "/");
+ strcat(wdir, AFS_CELLSERVDB_UNIX);
+ /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/
+ tfilep = fopen(wdir, "r");
+ if (!tfilep) return -2;
+ }
+
bestp = fopen(wdir, "r");
/* have we seen the cell line for the guy we're looking for? */
else inRightCell = 0;
}
else {
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
valuep = strchr(lineBuffer, '#');
if (valuep == NULL) {
fclose(tfilep);
return -4;
}
valuep++; /* skip the "#" */
+
valuep += strspn(valuep, " "); /* skip SP & TAB */
+#endif /* !DJGPP */
if (inRightCell) {
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
/* add the server to the VLDB list */
thp = gethostbyname(valuep);
if (thp) {
(*procp)(rockp, &vlSockAddr, valuep);
foundCell = 1;
}
+#else
+ /* For DJGPP, we will read IP address instead
+ of name/comment field */
+ code = sscanf(lineBuffer, "%d.%d.%d.%d #%s",
+ &c1, &c2, &c3, &c4, aname);
+ tp = (char *) &ip_addr;
+ *tp++ = c1;
+ *tp++ = c2;
+ *tp++ = c3;
+ *tp++ = c4;
+ memcpy(&vlSockAddr.sin_addr.s_addr, &ip_addr,
+ sizeof(long));
+ vlSockAddr.sin_family = AF_INET;
+ /* sin_port supplied by connection code */
+ if (procp)
+ (*procp)(rockp, &vlSockAddr, valuep);
+ foundCell = 1;
+#endif /* !DJGPP */
}
} /* a vldb line */
} /* while loop processing all lines */
}
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
/* look up the root cell's name in the Registry */
long cm_GetRootCellName(char *cellNamep)
{
return 0;
}
+#else
+/* look up the root cell's name in the THISCELL file */
+long cm_GetRootCellName(char *cellNamep)
+{
+ FILE *thisCell;
+ char thisCellPath[256];
+ char *afsconf_path;
+ char *newline;
+
+#ifdef DJGPP
+ strcpy(thisCellPath, cm_confDir);
+#else
+ /* Win 95 */
+ afsconf_path = getenv("AFSCONF");
+ if (!afsconf_path)
+ strcpy(thisCellPath, AFSDIR_CLIENT_ETC_DIRPATH);
+ else
+ strcpy(thisCellPath, afsconf_path);
+#endif
+ strcat(thisCellPath,"/");
+
+ strcat(thisCellPath, AFS_THISCELL);
+ thisCell = fopen(thisCellPath, "r");
+ if (thisCell == NULL)
+ return -1;
+
+ fgets(cellNamep, 256, thisCell);
+ fclose(thisCell);
+
+ newline = strrchr(cellNamep,'\n');
+ if (newline) *newline = '\0';
+ newline = strrchr(cellNamep,'\r');
+ if (newline) *newline = '\0';
+
+ return 0;
+}
+#endif /* !DJGPP */
cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
{
long code;
long tlen;
FILE *tfilep;
+ char *afsconf_path;
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
code = GetWindowsDirectory(wdir, sizeof(wdir));
if (code == 0 || code > sizeof(wdir)) return NULL;
/* add trailing backslash, if required */
tlen = strlen(wdir);
if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
+#else
+#ifdef DJGPP
+ strcpy(wdir,cm_confDir);
+#else
+ afsconf_path = getenv("AFSCONF");
+ if (!afsconf_path)
+ strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
+ else
+ strcpy(wdir, afsconf_path);
+#endif /* !DJGPP */
+ strcat(wdir,"/");
+#endif /* DJGPP || WIN95 */
strcat(wdir, namep);
return ((cm_configFile_t *) tfilep);
}
+#ifndef DJGPP
long cm_WriteConfigString(char *labelp, char *valuep)
{
DWORD code, dummyDisp;
return 0;
}
+#endif /* !DJGPP */
+#ifndef DJGPP
long cm_WriteConfigInt(char *labelp, long value)
{
DWORD code, dummyDisp;
return 0;
}
+#endif /* !DJGPP */
cm_configFile_t *cm_OpenCellFile(void)
{
int inRightCell;
int foundCell;
- tfilep = cm_CommonOpen("afsdcell.ini", "r");
+ tfilep = cm_CommonOpen(AFS_CELLSERVDB, "r");
if (!tfilep) return -1;
foundCell = 0;
long code;
long closeCode;
int tlen;
+ char *afsconf_path;
closeCode = fclose((FILE *)filep);
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
code = GetWindowsDirectory(wdir, sizeof(wdir));
- if (code == 0 || code > sizeof(wdir)) return -1;
+ if (code == 0 || code > sizeof(wdir)) return NULL;
/* add trailing backslash, if required */
tlen = strlen(wdir);
if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
+#else
+#ifdef DJGPP
+ strcpy(wdir,cm_confDir);
+#else
+ afsconf_path = getenv("AFSCONF");
+ if (!afsconf_path)
+ strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
+ else
+ strcpy(wdir, afsconf_path);
+#endif /* !DJGPP */
+ strcat(wdir,"/");
+#endif /* DJGPP || WIN95 */
+
strcpy(sdir, wdir);
if (closeCode != 0) {
return closeCode;
}
- strcat(wdir, "afsdcell.ini");
+ strcat(wdir, AFS_CELLSERVDB);
strcat(sdir, "afsdcel2.ini"); /* new file */
unlink(wdir); /* delete old file */
#ifndef __CM_CONFIG_INTERFACES_ONLY__
#include <stdio.h>
+#ifdef DJGPP
+#include <netinet/in.h>
+#endif /* DJGPP */
extern char AFSConfigKeyName[];
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif /* !DJGPP */
#include <string.h>
#include <malloc.h>
#include <osi.h>
#include <rx/rx.h>
+#ifndef DJGPP
#include <rxkad.h>
+#else
+#include <rx/rxkad.h>
+#endif
#include "afsd.h"
void cm_InitReq(cm_req_t *reqp)
{
memset((char *)reqp, 0, sizeof(cm_req_t));
+#ifndef DJGPP
reqp->startTime = GetCurrentTime();
+#else
+ gettimeofday(&reqp->startTime, NULL);
+#endif
+
}
long cm_GetServerList(struct cm_fid *fidp, struct cm_user *userp,
if (tsrp->status == busy)
tsrp->status = not_busy;
}
- Sleep(5000);
+ thrd_Sleep(5000);
retry = 1;
}
int same;
/* Back off to allow move to complete */
- Sleep(2000);
+ thrd_Sleep(2000);
/* Update the volume location and see if it changed */
cm_GetServerList(fidp, userp, reqp, &serversp);
* this is to prevent the SMB session from timing out
* In addition, we log an event to the event log
*/
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
char s[100];
ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1009, NULL,
1, 0, ptbuf, NULL);
DeregisterEventSource(h);
+#endif /* !DJGPP */
retry = 0;
osi_Log0(afsd_logp, "cm_Analyze: hardDeadTime exceeded");
long firstError = 0;
int someBusy = 0, someOffline = 0;
long timeUsed, timeLeft, hardTimeLeft;
+#ifdef DJGPP
+ struct timeval now;
+#endif /* DJGPP */
*connpp = NULL;
+#ifndef DJGPP
timeUsed = (GetCurrentTime() - reqp->startTime) / 1000;
+#else
+ gettimeofday(&now, NULL);
+ timeUsed = sub_time(now, reqp->startTime) / 1000;
+#endif
+
/* leave 5 seconds margin of safety */
timeLeft = RDRtimeout - timeUsed - 5;
hardTimeLeft = timeLeft;
VBUSY above. This is negative so that old
cache managers treat it as "server is down"*/
+#include "cm_server.h"
+
extern void cm_InitConn(void);
extern void cm_InitReq(cm_req_t *reqp);
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#else
+#include <netdb.h>
+#endif /* !DJGPP */
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
*/
gethostname(thostName, sizeof(thostName));
thp = gethostbyname(thostName);
- memcpy(&code, thp->h_addr_list[0], 4);
+ if (thp == NULL) /* In djgpp, gethostname returns the netbios
+ name of the machine. gethostbyname will fail
+ looking this up if it differs from DNS name. */
+ code = 0;
+ else
+ memcpy(&code, thp->h_addr_list[0], 4);
srand(ntohl(code));
now = osi_Time();
lastTokenCacheCheck = now - cm_daemonTokenCheckInterval/2 + (rand() % cm_daemonTokenCheckInterval);
while (1) {
- Sleep(30 * 1000); /* sleep 30 seconds */
+ thrd_Sleep(30 * 1000); /* sleep 30 seconds */
/* find out what time it is */
now = osi_Time();
{
static osi_once_t once;
long pid;
- HANDLE phandle;
+ thread_t phandle;
int i;
if (osi_Once(&once)) {
osi_EndOnce(&once);
/* creating pinging daemon */
- phandle = CreateThread((SECURITY_ATTRIBUTES *) 0, 0,
- (LPTHREAD_START_ROUTINE) cm_Daemon, 0, 0, &pid);
+ phandle = thrd_Create((SecurityAttrib) 0, 0,
+ (ThreadFunc) cm_Daemon, 0, 0, &pid, "cm_Daemon");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
for(i=0; i < nDaemons; i++) {
- phandle = CreateThread((SECURITY_ATTRIBUTES *) 0, 0,
- (LPTHREAD_START_ROUTINE) cm_BkgDaemon, 0, 0, &pid);
+ phandle = thrd_Create((SecurityAttrib) 0, 0,
+ (ThreadFunc) cm_BkgDaemon, 0, 0, &pid,
+ "cm_BkgDaemon");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
}
}
}
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#include <nb30.h>
+#endif /* !DJGPP */
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
-#include <nb30.h>
#include <osi.h>
#include "afsd.h"
lock_ReleaseMutex(&scp->mx);
+#ifdef DISKCACHE95
+ DPRINTF("cm_GetBuffer: fetching data scpDV=%d bufDV=%d scp=%x bp=%x dcp=%x\n",
+ scp->dataVersion, bufp->dataVersion, scp, bufp, bufp->dcp);
+#endif /* DISKCACHE95 */
+
/* now make the call */
do {
code = cm_Conn(&scp->fid, up, reqp, &connp);
qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) {
tbufp = osi_GetQData(qdp);
tbufp->dataVersion = afsStatus.DataVersion;
+
+#ifdef DISKCACHE95
+ /* write buffer out to disk cache */
+ diskcache_Update(tbufp->dcp, tbufp->datap, buf_bufferSize,
+ tbufp->dataVersion);
+#endif /* DISKCACHE95 */
}
}
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif /* !DJGPP */
#include <string.h>
#include <malloc.h>
#include <osi.h>
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* This code is experimental persistent disk cache support for the
+ Windows 95/DJGPP AFS client. It uses synchronous I/O and assumes
+ non-preemptible threads (which is the case in DJGPP), so it has
+ no locking. */
+
+
+#ifdef DISKCACHE95
+
+#include <afs/param.h>
+#include <afs/stds.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/errno.h>
+#include <sys/stat.h>
+
+#include "afsd.h"
+
+cm_diskcache_t **diskHashTable; /* pointers to hash chains */
+Queue diskLRUList;
+Queue openFileList;
+cm_diskcache_t *diskCBBuf;
+
+extern int afs_diskCacheChunks;
+/*extern int cm_diskCacheChunkSize;*/
+extern long buf_bufferSize;
+long cm_diskCacheChunkSize;
+extern char cm_cachePath[];
+extern int cm_cachePathLen;
+extern int cm_diskCacheEnabled;
+
+int cacheInfo_fd;
+int accessOrd = 0; /* monotonically increasing access ordinal */
+int updates = 0;
+int afs_dhashsize = 2048;
+int openCacheFiles = 0;
+
+char cacheInfoPath[128];
+char cacheFileName[128];
+
+extern int errno;
+
+#define MAX_OPEN_FILES 22
+
+/* internal functions */
+void diskcache_WriteCacheInfo(cm_diskcache_t *dcp);
+int diskcache_New();
+cm_diskcache_t *diskcache_Find(cm_fid_t *fid, int chunk);
+cm_diskcache_t *diskcache_Alloc(cm_fid_t *fid, int chunk, int dataVersion);
+int diskcache_Read(cm_diskcache_t *dcp, char *buf, int size);
+int diskcache_Write(cm_diskcache_t *dcp, char *buf, int size);
+
+#define complain printf
+
+#define OFFSET_TO_CHUNK(a) (LargeIntegerDivideByLong((a), cm_diskCacheChunkSize))
+#define GEN_CACHE_DIR_NAME(name, path, i) \
+ sprintf(name, "%s\\D%07d", cm_cachePath, (i) / CACHE_FILES_PER_DIR)
+#define GEN_CACHE_FILE_NAME(name, path, i) \
+ sprintf(name, "%s\\D%07d\\C%07d", path, (i) / CACHE_FILES_PER_DIR, \
+ (i) % CACHE_FILES_PER_DIR)
+
+/* Initialize the disk cache */
+int diskcache_Init()
+{
+ int i;
+ int rc;
+ int fd;
+ int invalid;
+ int index;
+ char *chunkBuf;
+ char tmpBuf[512];
+ struct stat cacheInfoStat, chunkStat;
+ cm_cacheInfoHdr_t hdr;
+ cm_diskcache_t *dcp;
+ int validCount = 0;
+
+ if (!cm_diskCacheEnabled)
+ return 0;
+
+ cm_diskCacheChunkSize = buf_bufferSize;
+ if (cm_diskCacheChunkSize % buf_bufferSize != 0)
+ {
+ complain("Error: disk cache chunk size %d not a multiple of buffer size %d\n",
+ cm_diskCacheChunkSize, buf_bufferSize);
+ return CM_ERROR_INVAL;
+ }
+
+ /* alloc mem for chunk file control blocks */
+ diskCBBuf = (cm_diskcache_t *) malloc(afs_diskCacheChunks * sizeof(cm_diskcache_t));
+ if (diskCBBuf == NULL)
+ return CM_ERROR_SPACE;
+ memset(diskCBBuf, 0, afs_diskCacheChunks * sizeof(cm_diskcache_t));
+
+ /* alloc mem for hash table pointers */
+ diskHashTable = (cm_diskcache_t **) malloc(afs_dhashsize * sizeof(cm_diskcache_t *));
+ if (diskHashTable == NULL)
+ return CM_ERROR_SPACE;
+ memset(diskHashTable, 0, afs_dhashsize*sizeof(cm_diskcache_t *));
+
+ QInit(&diskLRUList);
+ QInit(&openFileList);
+
+ /*sprintf(cacheInfoPath, "%s\\%s", cm_cachePath, CACHE_INFO_FILE);*/
+ memset(cacheInfoPath, 0, 128);
+ DPRINTF("cm_cachePath=%s\n", cm_cachePath);
+ strncpy(cacheInfoPath, cm_cachePath, 50);
+ strcat(cacheInfoPath, "\\");
+ strcat(cacheInfoPath, CACHE_INFO_FILE);
+ DPRINTF("cacheInfoPath=%s\n", cacheInfoPath);
+
+ cacheInfo_fd = open(cacheInfoPath, O_RDWR | O_BINARY);
+
+ if (cacheInfo_fd < 0)
+ {
+ /* file not present */
+ return diskcache_New(); /* initialize new empty disk cache */
+ }
+
+ /* get stat of cache info file */
+ rc = fstat(cacheInfo_fd, &cacheInfoStat);
+
+ /* Check for valid header in cache info file */
+ rc = read(cacheInfo_fd, &hdr, sizeof(cm_cacheInfoHdr_t));
+ if (rc < sizeof(cm_cacheInfoHdr_t) ||
+ hdr.magic != CACHE_INFO_MAGIC)
+ /*hdrp = (cm_cacheInfoHdr_t *) tmpBuf;*/
+ {
+ close(cacheInfo_fd);
+ return diskcache_New();
+ }
+
+ if (hdr.chunks != afs_diskCacheChunks ||
+ hdr.chunkSize != cm_diskCacheChunkSize)
+ {
+ /* print error message saying params don't match */
+ return CM_ERROR_INVAL;
+ }
+
+ chunkBuf = (char *) malloc(cm_diskCacheChunkSize);
+ if (chunkBuf == NULL)
+ return CM_ERROR_SPACE;
+
+ /* read metadata from cache info file into control blocks */
+ /* reconstruct hash chains based on fid, chunk */
+ for (i = 0; i < afs_diskCacheChunks; i++)
+ { /* for all cache chunks */
+ if (i % 500 == 0)
+ {
+ printf("%d...", i);
+ fflush(stdout);
+ }
+ dcp = &diskCBBuf[i];
+ dcp->refCount = 0;
+ rc = read(cacheInfo_fd, &dcp->f, sizeof(struct fcache));
+ if (rc < sizeof(struct fcache))
+ {
+ /* print error message about reading cache info file */
+ /* this isn't the right error code for a read error */
+ return CM_ERROR_INVAL;
+ }
+
+ if (dcp->f.index != i)
+ return CM_ERROR_INVAL; /* index should match position in cache info file */
+
+ /* Try to open cache file. This chunk will be invalidated if we can't
+ find the file, the file is newer than the cache info file, the file
+ size doesn't match the cache info file, or the file's header is
+ invalid. */
+ GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, i);
+#if 1
+ /*fd = open(cacheFileName, O_RDWR | O_BINARY);
+ if (fd < 0) invalid = 1;
+ else
+ {
+ rc = fstat(fd, &chunkStat);*/
+ rc = stat(cacheFileName, &chunkStat);
+
+ if (rc < 0) invalid = 1;
+ /*else if (cacheInfoStat.st_mtime < chunkStat.st_mtime + 120) invalid = 1;*/
+ else if (cacheInfoStat.st_mtime < chunkStat.st_mtime) invalid = 1;
+ /*else if (cacheInfoStat.st_mtime < dcp->f.modTime + 120) invalid = 1;*/
+ else if (cacheInfoStat.st_mtime < dcp->f.modTime) invalid = 1;
+ else if (cm_diskCacheChunkSize != chunkStat.st_size ||
+ dcp->f.chunkBytes != chunkStat.st_size) invalid = 1;
+ /*else
+ {*/
+ /*rc = read(fd, chunkBuf, cm_diskCacheChunkSize);
+ if (rc < 0) invalid = 1;*/
+
+ /*else
+ {
+ cacheFileHdrP = (cm_cacheFileHdr_t *) chunkBuf;
+ if (cacheFileHdrP->magic != CACHE_FILE_MAGIC ||
+ cacheFileHdrP->index != i)
+ {
+ invalid = 1;
+ }
+ }*/
+ /*}*/
+ /*}*/
+#else
+ invalid = 0;
+#endif
+
+ if (invalid == 0)
+ {
+ /* Cache file seems to be valid */
+
+ validCount++;
+ DPRINTF("Found fid/chunk=%08x-%08x-%08x-%08x/%04d in slot=%d dcp=%x\n",
+ dcp->f.fid.cell, dcp->f.fid.volume, dcp->f.fid.vnode,
+ dcp->f.fid.unique, dcp->f.chunk, i, dcp);
+ /* Put control block in hash table */
+ index = DCHash(&dcp->f.fid, dcp->f.chunk);
+ /*osi_QAdd(&diskHashTable[index], &dcp->f.hashq);*/
+
+ /* add to head of hash list. (we should probably look at
+ ord here instead. use queues?) */
+ dcp->hash_next = diskHashTable[index];
+ dcp->hash_prev = NULL;
+ if (diskHashTable[index]) diskHashTable[index]->hash_prev = dcp;
+ diskHashTable[index] = dcp;
+
+ /* Add to LRU queue in access time order (lowest at tail) */
+ QAddOrd(&diskLRUList, &dcp->lruq, dcp->f.accessOrd);
+
+ close(fd);
+ }
+ else
+ {
+ /* Cache file is invalid */
+
+ /* Create the cache file with correct size */
+ memset(chunkBuf, 0, cm_diskCacheChunkSize);
+ /*cacheFileHdrP->magic = CACHE_FILE_MAGIC;
+ cacheFileHdrP->index = i;*/
+
+ if (fd != 0) close(fd);
+ /* Note that if the directory this file is supposed to be in doesn't
+ exist, the creat call will fail and we will return an error. */
+ /*fd = creat(cacheFileName, S_IRUSR|S_IWUSR);*/
+ fd = open(cacheFileName, O_RDWR | O_BINARY | O_CREAT | O_TRUNC,
+ S_IRUSR | S_IWUSR);
+ if (fd < 0) return CM_ERROR_INVAL; /* couldn't create file */
+ rc = write(fd, chunkBuf, cm_diskCacheChunkSize);
+ if (rc < 0) /* ran out of space? */
+ return CM_ERROR_INVAL;
+ close(fd);
+
+ /* We consider an invalid chunk as empty, so we put it at tail of LRU */
+ memset(dcp, 0, sizeof(cm_diskcache_t));
+ dcp->f.accessOrd = 0;
+ dcp->f.states = DISK_CACHE_EMPTY;
+ dcp->f.index = i;
+ dcp->f.chunkBytes = cm_diskCacheChunkSize;
+ /*osi_QAdd(diskLRUList, &dcp->lruq);*/
+ QAddOrd(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* head is LRU */
+
+ /* write out cache info modifications */
+ lseek(cacheInfo_fd, -sizeof(struct fcache), SEEK_CUR);
+ write(cacheInfo_fd, &dcp->f, sizeof(struct fcache));
+ }
+ } /* for all cache chunks */
+
+ free(chunkBuf);
+ /*close(cacheInfo_fd);*/
+ fprintf(stderr, "\nFound %d of %d valid %d-byte blocks\n", validCount,
+ afs_diskCacheChunks, cm_diskCacheChunkSize);
+
+ return 0;
+}
+
+/* create empty disk cache files */
+/* assumes tables have already been malloc'd by diskcache_Init */
+int diskcache_New()
+{
+ int i;
+ int rc;
+ int fd;
+ int invalid;
+ int index;
+ /*char cacheInfoPath[256];
+ char cacheFileName[256];*/
+ char dirName[256];
+ char *chunkBuf;
+ struct stat cacheInfoStat, chunkStat;
+ cm_cacheInfoHdr_t hdr;
+ cm_diskcache_t *dcp;
+
+ sprintf(cacheInfoPath, "%s\\%s", cm_cachePath, CACHE_INFO_FILE);
+ /*cacheInfo_fd = creat(cacheInfoPath, S_IRUSR | S_IWUSR);*/
+ cacheInfo_fd = open(cacheInfoPath, O_RDWR | O_BINARY | O_CREAT | O_TRUNC,
+ S_IRUSR | S_IWUSR);
+ if (cacheInfo_fd < 0)
+ {
+ complain("diskcache_New: Error creating cache info file in cache directory %s\n",
+ cm_cachePath);
+ return CM_ERROR_INVAL;
+ }
+
+ /* write valid header */
+ hdr.magic = CACHE_INFO_MAGIC;
+ hdr.chunks = afs_diskCacheChunks;
+ hdr.chunkSize = cm_diskCacheChunkSize;
+ rc = write(cacheInfo_fd, (char *) &hdr, sizeof(cm_cacheInfoHdr_t));
+ if (rc < 0)
+ return CM_ERROR_INVAL;
+
+ chunkBuf = (char *) malloc(cm_diskCacheChunkSize);
+ if (chunkBuf == NULL)
+ return CM_ERROR_SPACE;
+ memset(chunkBuf, 0, cm_diskCacheChunkSize);
+
+ for (i = 0; i < afs_diskCacheChunks; i++)
+ { /* for all cache chunks */
+ if (i % 500 == 0)
+ {
+ printf("%d...", i);
+ fflush(stdout);
+ }
+
+ dcp = &diskCBBuf[i];
+
+ dcp->refCount = 0;
+ /* $$$: init mutex mx */
+ memset(dcp, 0, sizeof(cm_diskcache_t));
+ dcp->f.accessOrd = 0;
+ dcp->f.index = i;
+ dcp->f.states = DISK_CACHE_EMPTY;
+ dcp->f.chunkBytes = cm_diskCacheChunkSize;
+ QAddT(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* head is LRU */
+ rc = write(cacheInfo_fd, &dcp->f, sizeof(struct fcache));
+
+ if (i % CACHE_FILES_PER_DIR == 0)
+ {
+ GEN_CACHE_DIR_NAME(dirName, cm_cachePath, i);
+ rc = mkdir(dirName, S_IRUSR | S_IWUSR);
+ if (rc < 0 && errno != EEXIST)
+ {
+ complain("diskcache_New: Couldn't create cache directory %s\n", dirName);
+ return CM_ERROR_INVAL;
+ }
+ }
+
+ GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, i);
+ /*fd = creat(cacheFileName, S_IRUSR | S_IWUSR);*/
+ fd = open(cacheFileName, O_RDWR | O_BINARY | O_CREAT | O_TRUNC,
+ S_IRUSR | S_IWUSR);
+ if (fd < 0)
+ {
+ if (errno == ENOSPC)
+ complain("diskcache_New: Not enough space in cache path to create file %s\n",
+ cacheFileName);
+ else
+ complain("diskcache_New: Couldn't create cache file %s\n", cacheFileName);
+ return CM_ERROR_INVAL;
+ }
+
+ /*fileHdr.magic = CACHE_FILE_MAGIC;
+ fileHdr.index = i;
+ rc = write(fd, &fileHdr, sizeof(cm_cacheFileHdr_t)); /* maybe we should write
+ a full block? */
+ /*if (rc == 0)
+ {*/
+ rc = write(fd, chunkBuf, cm_diskCacheChunkSize);
+ /*}*/
+
+ if (rc < 0)
+ {
+ if (errno == ENOSPC)
+ complain("diskcache_New: Not enough space in cache path to write to file %s\n",
+ cacheFileName);
+ else
+ complain("diskcache_New: Couldn't write to cache file %s\n",
+ cacheFileName);
+ return CM_ERROR_INVAL;
+ }
+
+ close(fd);
+ } /* for all cache chunks */
+
+ free(chunkBuf);
+
+ /*close(cacheInfo_fd);*/
+
+ return 0;
+}
+
+/* Get chunk from the cache or allocate a new chunk */
+int diskcache_Get(cm_fid_t *fid, osi_hyper_t *offset, char *buf, int size, int *dataVersion, int *dataCount, cm_diskcache_t **dcpRet)
+{
+ cm_diskcache_t *dcp;
+ int rc;
+ int chunk;
+
+
+ if (!cm_diskCacheEnabled)
+ {
+ *dcpRet = NULL;
+ return 0;
+ }
+
+ chunk = OFFSET_TO_CHUNK(*offset); /* chunk number */
+
+ DPRINTF("diskcache_Get: fid/chunk=%08x-%08x-%08x-%08x/%04d\n",
+ fid->cell, fid->volume, fid->vnode, fid->unique, chunk);
+
+ dcp = diskcache_Find(fid, chunk);
+ if (dcp != NULL)
+ {
+ rc = diskcache_Read(dcp, buf, size);
+ *dataVersion = dcp->f.dataVersion; /* update caller's data version */
+ if (rc < 0)
+ return -1;
+ else
+ *dataCount = rc;
+ }
+ else
+ {
+ dcp = diskcache_Alloc(fid, chunk, *dataVersion);
+ if (dcp == NULL)
+ return -1;
+ }
+
+ if (++updates >= CACHE_INFO_UPDATES_PER_WRITE)
+ {
+ updates = 0;
+ diskcache_WriteCacheInfo(dcp); /* update cache info for this slot */
+ }
+
+ *dcpRet = dcp;
+ /*printf("diskcache_Get: returning dcp=%x\n", dcp);*/
+ return 0;
+}
+
+
+/* Look for a file chunk in the cache */
+cm_diskcache_t *diskcache_Find(cm_fid_t *fid, int chunk)
+{
+ int index;
+ cm_diskcache_t *dcp;
+ cm_diskcache_t *prev;
+
+ index = DCHash(fid, chunk);
+ dcp = diskHashTable[index];
+ prev = NULL;
+
+ while (dcp != NULL)
+ {
+ if (cm_FidCmp(&dcp->f.fid, fid) == 0 && chunk == dcp->f.chunk)
+ {
+ dcp->f.accessOrd = accessOrd++;
+ /* Move it to the beginning of the list */
+ if (diskHashTable[index] != dcp)
+ {
+ assert(dcp->hash_prev->hash_next == dcp);
+ dcp->hash_prev->hash_next = dcp->hash_next;
+ if (dcp->hash_next)
+ {
+ assert(dcp->hash_next->hash_prev == dcp);
+ dcp->hash_next->hash_prev = dcp->hash_prev;
+ }
+ dcp->hash_next = diskHashTable[index];
+ dcp->hash_prev = NULL;
+ if (diskHashTable[index]) diskHashTable[index]->hash_prev = dcp;
+ diskHashTable[index] = dcp;
+ }
+ break;
+ }
+ prev = dcp;
+ dcp = dcp->hash_next;
+ }
+
+ if (dcp)
+ DPRINTF("diskcache_Find: fid/chunk=%08x-%08x-%08x-%08x/%04d slot=%d hash=%d dcp=%x\n",
+ fid->cell, fid->volume, fid->vnode, fid->unique, chunk, dcp->f.index, index, dcp);
+ else
+ DPRINTF("diskcache_Find: fid/chunk=%08x/%04d not found\n",
+ fid->unique, chunk);
+
+ return dcp;
+}
+
+int diskcache_Read(cm_diskcache_t *dcp, char *buf, int size)
+{
+ char cacheFileName[256];
+ int fd;
+ int rc;
+ int opened = 0;
+
+ GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, dcp->f.index);
+
+ DPRINTF("diskcache_Read: filename=%s dcp=%x\n", cacheFileName,
+ dcp);
+
+ /* For reads, we will use the fd if already open, but we won't leave
+ the file open. Note that if we use async I/O, we will need to
+ do locking to prevent someone from closing the file while I/O
+ is going on. But for now, all I/O is synchronous, and threads
+ are non-preemptible. */
+
+ if (dcp->openfd == 0)
+ {
+ fd = open(cacheFileName, O_RDWR | O_BINARY);
+ if (fd < 0)
+ {
+ complain("diskcache_Read: Couldn't open cache file %s\n", cacheFileName);
+ return -1;
+ }
+ opened = 1;
+ }
+ else
+ fd = dcp->openfd;
+
+ if (fd < 0)
+ {
+ complain("diskcache_Read: Couldn't open cache file %s\n", cacheFileName);
+ return -1;
+ }
+
+ rc = read(fd, buf, size);
+ if (rc < 0)
+ {
+ complain("diskcache_Read: Couldn't read cache file %s\n", cacheFileName);
+ close(fd); return -1;
+ }
+
+ if (opened)
+ close(fd); /* close it if we opened it */
+ return rc; /* bytes read */
+}
+
+/* Write out buffer to disk */
+int diskcache_Update(cm_diskcache_t *dcp, char *buf, int size, int dataVersion)
+{
+ if (!cm_diskCacheEnabled)
+ return 0;
+
+ DPRINTF("diskcache_Update dcp=%x, dataVersion=%d\n", dcp, dataVersion);
+ diskcache_Write(dcp, buf, size);
+ /*diskcache_SetMRU(dcp);*/
+ dcp->f.dataVersion = dataVersion;
+ /*dcp->f.accessOrd = accessOrd++;*/
+ /*QMoveToTail(&diskLRUList, &dcp->lruq, dcp->f.accessOrd);*/
+
+ if (++updates >= CACHE_INFO_UPDATES_PER_WRITE)
+ {
+ updates = 0;
+ diskcache_WriteCacheInfo(dcp); /* update cache info */
+ }
+ return 0;
+}
+
+/* Allocate a new chunk file control block for this fid/chunk */
+cm_diskcache_t *diskcache_Alloc(cm_fid_t *fid, int chunk, int dataVersion)
+{
+ cm_diskcache_t *dcp;
+ QLink* q;
+ int index;
+ int stole=0, stolen_chunk, stolen_fid_unique;
+
+ /* Remove LRU elt. (head) from free list */
+ q = QServe(&diskLRUList);
+ if (q == NULL)
+ dcp = NULL;
+ else
+ dcp = (cm_diskcache_t *) MEM_TO_OBJ(cm_diskcache_t, lruq, q);
+ if (dcp == NULL)
+ {
+ DPRINTF("diskcache_Alloc: fid/chunk=%08x/%04d allocation failed\n",
+ fid->unique, chunk);
+ return NULL;
+ }
+
+ /* Use this element for this fid/chunk */
+ if (dcp->f.states == DISK_CACHE_USED)
+ {
+ /* Remove from old hash chain */
+ if (dcp->hash_prev)
+ {
+ assert(dcp->hash_prev->hash_next == dcp);
+ dcp->hash_prev->hash_next = dcp->hash_next;
+ }
+ else
+ {
+ index = DCHash(&dcp->f.fid, dcp->f.chunk);
+ diskHashTable[index] = dcp->hash_next;
+ }
+ if (dcp->hash_next)
+ {
+ assert(dcp->hash_next->hash_prev == dcp);
+ dcp->hash_next->hash_prev = dcp->hash_prev;
+ }
+
+ stole = 1;
+ stolen_chunk = dcp->f.chunk;
+ stolen_fid_unique = dcp->f.fid.unique;
+ }
+
+ memcpy(&dcp->f.fid, fid, sizeof(cm_fid_t));
+ dcp->f.chunk = chunk;
+ dcp->f.dataVersion = dataVersion;
+ dcp->f.accessOrd = accessOrd++;
+ dcp->f.states = DISK_CACHE_USED;
+
+ /* allocate at head of new hash chain */
+ index = DCHash(fid, chunk);
+ /*osi_QAddH(&diskHashTable[index], &dcp->hashq);*/
+ dcp->hash_next = diskHashTable[index];
+ dcp->hash_prev = NULL;
+ if (diskHashTable[index]) diskHashTable[index]->hash_prev = dcp;
+ diskHashTable[index] = dcp;
+
+ /* put at tail of queue */
+ QAddT(&diskLRUList, &dcp->lruq, dcp->f.accessOrd);
+
+ if (stole)
+ DPRINTF("diskcache_Alloc: fid/chunk=%08x/%04d (recyc fid/chunk=%08x/%04d) "
+ "slot=%d hash=%d dcp=%x\n",
+ fid->unique, chunk, stolen_fid_unique, stolen_chunk,
+ dcp->f.index, index, dcp);
+ else
+ DPRINTF("diskcache_Alloc: fid/chunk=%08x/%04d slot=%d hash=%d dcp=%x\n",
+ fid->unique, chunk, dcp->f.index, index, dcp);
+ return dcp;
+}
+
+/* Write this chunk to its disk file */
+int diskcache_Write(cm_diskcache_t *dcp, /*int bufferNum,*/ char *buf, int size)
+{
+ char cacheFileName[256];
+ int fd;
+ int rc;
+ int opened = 0;
+ QLink *q;
+
+ /*return 0;*/
+
+ DPRINTF("diskcache_Write\n");
+
+ /* write bytes of buf into chunk file */
+ GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, dcp->f.index);
+ if (dcp->openfd == 0)
+ {
+ dcp->openfd = open(cacheFileName, O_RDWR | O_BINARY);
+ if (dcp->openfd < 0)
+ {
+ dcp->openfd = 0;
+ complain("diskcache_Write: Couldn't open cache file %s\n", cacheFileName);
+ return -1;
+ }
+ opened = 1;
+ }
+
+ /*lseek(dcp->openfd, bufferNum * buf_bufferSize, SEEK_SET);*/
+ /* only write size bytes */
+ rc = write(dcp->openfd, buf, size);
+ if (rc < 0)
+ {
+ complain("diskcache_Write: Couldn't write cache file %s\n", cacheFileName);
+ close(dcp->openfd); dcp->openfd = 0; return rc;
+ }
+
+ if (opened)
+ {
+ /* add to open file list */
+ QAddT(&openFileList, &dcp->openq, 0);
+ openCacheFiles++;
+ }
+ else
+ QMoveToTail(&openFileList, &dcp->openq, 0);
+
+ if (openCacheFiles >= MAX_OPEN_FILES)
+ {
+ /* close longest-open file */
+ q = QServe(&openFileList);
+ dcp = (cm_diskcache_t *) MEM_TO_OBJ(cm_diskcache_t, openq, q);
+ assert(dcp != NULL);
+ if (dcp->openfd > 0)
+ close(dcp->openfd);
+ dcp->openfd = 0;
+ openCacheFiles--;
+ }
+
+ return 0;
+}
+
+/* we accessed this chunk (hit on buffer read), so move to MRU */
+void diskcache_Touch(cm_diskcache_t *dcp)
+{
+ if (!cm_diskCacheEnabled || !dcp) return;
+ dcp->f.accessOrd = accessOrd++;
+ QMoveToTail(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* tail is MRU */
+}
+
+/* invalidate this disk cache entry */
+int diskcache_Invalidate(cm_diskcache_t *dcp)
+{
+ /* We consider an invalid chunk as empty, so we put it at tail of LRU */
+ QRemove(&diskLRUList, &dcp->lruq);
+
+ dcp->f.accessOrd = 0;
+ dcp->f.states = DISK_CACHE_EMPTY;
+ dcp->f.chunk = 0;
+ memset(&dcp->f.fid, sizeof(cm_fid_t));
+ /*osi_QAdd(diskLRUList, &dcp->lruq);*/
+ QAddH(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* head is LRU */
+}
+
+void diskcache_WriteCacheInfo(cm_diskcache_t *dcp)
+{
+ /*char cacheInfoPath[256];
+ int cacheInfo_fd;*/
+ int rc;
+
+ /*return; /* skip this for perf. testing */
+ /*sprintf(cacheInfoPath, "%s\\%s", cm_cachePath, CACHE_INFO_FILE);
+ cacheInfo_fd = open(cacheInfoPath, O_RDWR);*/
+
+ DPRINTF("diskcache_WriteCacheInfo\n");
+
+ lseek(cacheInfo_fd, dcp->f.index * sizeof(struct fcache) +
+ sizeof(cm_cacheInfoHdr_t), SEEK_SET);
+
+ rc = write(cacheInfo_fd, &dcp->f, sizeof(struct fcache));
+ if (rc < 0)
+ complain("diskcache_WriteCacheInfo: Couldn't write cache info file, error=%d\n", errno);
+ /*fsync(cacheInfo_fd);*/
+
+ /*close(cacheInfo_fd);*/
+}
+
+void diskcache_Shutdown()
+{
+ cm_diskcache_t *dcp;
+ QLink *q;
+
+ /* close cache info file */
+ close (cacheInfo_fd);
+
+ /* close all open cache files */
+ q = QServe(&openFileList);
+ while (q)
+ {
+ dcp = (cm_diskcache_t *) MEM_TO_OBJ(cm_diskcache_t, openq, q);
+ if (dcp->openfd)
+ close(dcp->openfd);
+ q = QServe(&openFileList);
+ }
+}
+
+#endif /* DISKCACHE95 */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef CM_DISKCACHE_H
+#define CM_DISKCACHE_H
+
+#include "queue95.h"
+
+#define DCHash(v, c) ((((v)->vnode + (v)->volume + (c))) & (afs_dhashsize-1))
+
+#define CACHE_INFO_FILE "cacheInfo"
+
+#define CACHE_INFO_MAGIC 0x34564321
+#define CACHE_FILE_MAGIC 0x78931230
+#define CACHE_FILES_PER_DIR 1000
+#define CACHE_INFO_UPDATES_PER_WRITE 1
+
+#define DPRINTF if (0) printf
+
+/* kept on disk and in dcache entries */
+struct fcache {
+ cm_fid_t fid; /* Fid for this file */
+ int32 modTime; /* last time this entry was modified */
+ /*afs_hyper_t versionNo; /* Associated data version number */
+ int dataVersion;
+ int chunk; /* Relative chunk number */
+ int chunkBytes; /* Num bytes in this chunk */
+ char states; /* Has this chunk been modified? */
+ int accessOrd; /* change to 64 bit later */
+#define DISK_CACHE_EMPTY 0
+#define DISK_CACHE_USED 1
+ int index; /* absolute chunk number */
+ int checksum;
+ /*char pad[464]; /* pad up to 512 bytes */
+};
+
+/* in-memory chunk file control block */
+typedef struct cm_diskcache {
+ struct fcache f;
+
+ /*osi_queue_t lruq;
+ osi_queue_t hashq;*/
+ QLink lruq;
+ QLink openq;
+ int openfd; /* open file descriptor */
+ struct cm_diskcache *hash_next;
+ struct cm_diskcache *hash_prev;
+ int refCount;
+ osi_mutex_t mx;
+} cm_diskcache_t;
+
+typedef struct cm_cacheInfoHdr {
+ int magic;
+ int chunks; /* total chunks in cache */
+ int chunkSize;
+ char pad[500]; /* pad up to 512 bytes */
+} cm_cacheInfoHdr_t;
+
+typedef struct cm_cacheFileHdr {
+ int magic;
+ int index;
+} cm_cacheFileHdr_t;
+
+/* external functions */
+
+/* Initialize the disk cache */
+int diskcache_Init();
+/* Get chunk from the cache or allocate a new chunk */
+int diskcache_Get(cm_fid_t *fid, osi_hyper_t *offset, char *buf, int size, int *dataVersion, int *dataCount, cm_diskcache_t **dcpRet);
+/* Write out buffer to disk */
+int diskcache_Update(cm_diskcache_t *dcp, char *buf, int size, int dataVersion);
+/* we accessed this chunk, so move to MRU */
+void diskcache_Touch(cm_diskcache_t *dcp);
+
+#endif /* CM_DISKCACHE_H */
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#endif /* !DJGPP */
#include <string.h>
#include <stdlib.h>
#include <osi.h>
struct nc* nameHash[NHSIZE];
+#ifndef DJGPP
#define dnlcNotify(x,debug){ \
HANDLE hh; \
char *ptbuf[1]; \
DeregisterEventSource(hh); \
} \
}
+#else
+#define dnlcNotify(x,debug)
+#endif /* !DJGPP */
static struct nc *
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
#include <errno.h>
#include <stdlib.h>
#include <malloc.h>
#include "smb.h"
+#ifndef DJGPP
#include <rxkad.h>
-
#include "afsrpc.h"
+#else
+#include <rx/rxkad.h>
+#include "afsrpc95.h"
+#endif
+
#include "cm_rpc.h"
/* Copied from afs_tokens.h */
#define PIOCTL_LOGON 0x1
+#define MAX_PATH 260
osi_mutex_t cm_Afsdsbmt_Lock;
*/
void TranslateExtendedChars(char *str)
{
+ char *p;
+
if (!str || !*str)
return;
+#ifndef DJGPP
CharToOem(str, str);
+#else
+ p = str;
+ while (*p) *p++ &= 0x7f; /* turn off high bit; probably not right */
+#endif
}
/* parse the passed-in file name and do a namei on it. If we fail,
uname = tp;
tp += strlen(tp) + 1;
+#ifndef DJGPP /* for win95, session key is back in pioctl */
/* uuid */
memcpy(&uuid, tp, sizeof(uuid));
if (!cm_FindTokenEvent(uuid, sessionKey))
return CM_ERROR_INVAL;
+#endif /* !DJGPP */
} else
cellp = cm_rootCellp;
free(ucellp->ticketp); /* Discard old token if any */
ucellp->ticketp = malloc(ticketLen);
memcpy(ucellp->ticketp, ticket, ticketLen);
+#ifndef DJGPP
/*
* Get the session key from the RPC, rather than from the pioctl.
*/
memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
*/
memcpy(ucellp->sessionKey.data, sessionKey, sizeof(sessionKey));
+#else
+ /* for win95, we are getting the session key from the pioctl */
+ memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
+#endif /* !DJGPP */
ucellp->kvno = ct.AuthHandle;
ucellp->expirationTime = ct.EndTimestamp;
ucellp->gen++;
/* clear token */
ct.AuthHandle = ucellp->kvno;
+#ifndef DJGPP
/*
* Don't give out a real session key here
*/
memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
*/
memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey));
+#else
+ memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
+#endif /* !DJGPP */
ct.ViceId = 37; /* XXX */
ct.BeginTimestamp = 0; /* XXX */
ct.EndTimestamp = ucellp->expirationTime;
cm_ucell_t *ucellp;
struct ClearToken ct;
char *tp;
+#ifndef DJGPP
afs_uuid_t uuid;
+#endif /* !DJGPP */
cm_SkipIoctlPath(ioctlp);
if (!cellp) return CM_ERROR_NOSUCHCELL;
tp += strlen(tp) + 1;
+#ifndef DJGPP
/* uuid */
memcpy(&uuid, tp, sizeof(uuid));
+#endif /* !DJGPP */
lock_ObtainMutex(&userp->mx);
/* clear token */
ct.AuthHandle = ucellp->kvno;
+#ifndef DJGPP
/*
* Don't give out a real session key here
*/
memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
*/
memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey));
+#else
+ memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
+#endif /* !DJGPP */
ct.ViceId = 37; /* XXX */
ct.BeginTimestamp = 0; /* XXX */
ct.EndTimestamp = ucellp->expirationTime;
lock_ReleaseMutex(&userp->mx);
+#ifndef DJGPP
cm_RegisterNewTokenEvent(uuid, ucellp->sessionKey.data);
+#endif /* !DJGPP */
return 0;
}
return 0;
}
+
+#ifdef DJGPP
+extern int afsd_shutdown(int);
+extern int afs_shutdown;
+
+long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp)
+{
+ afs_shutdown = 1; /* flag to shut down */
+ return 0;
+}
+#endif /* DJGPP */
extern long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp);
+extern long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp);
+
+
#endif /* __CM_IOCTL_INTERFACES_ONLY__ */
#endif /* __CM_IOCTL_H_ENV__ */
#include <malloc.h>
#include <osi.h>
+#ifndef DJGPP
#include "afsrpc.h"
+#else
+#include "afsrpc95.h"
+#endif
#include "afsd.h"
#include "afsd_init.h"
#ifndef __CM_RPC_H__
#define __CM_RPC_H__
+#ifndef DJGPP
#include "afsrpc.h"
+#else
+#include "afsrpc95.h"
+#endif
void cm_RegisterNewTokenEvent(afs_uuid_t uuid, char sessionKey[8]);
BOOL cm_FindTokenEvent(afs_uuid_t uuid, char sessionKey[8]);
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef __CM_RPC_H__
+#define __CM_RPC_H__
+
+/* Copied from declaration of GUID in RPCDCE.H */
+typedef struct afs_uuid {
+ unsigned long Data1;
+ unsigned short Data2;
+ unsigned short Data3;
+ unsigned char Data4[8];
+} afs_uuid_t;
+
+long AFSRPC_SetToken(
+ afs_uuid_t uuid,
+ unsigned char sessionKey[8]
+);
+
+long AFSRPC_GetToken(
+ afs_uuid_t uuid,
+ unsigned char sessionKey[8]
+);
+
+#endif /* __CM_RPC_H__ */
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#include <nb30.h>
+#endif /* !DJGPP */
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
-#include <nb30.h>
#include <osi.h>
#include "afsd.h"
osi_assert(scp->refCount-- > 0);
lock_ReleaseWrite(&cm_scacheLock);
}
+
+/* just look for the scp entry to get filetype */
+/* doesn't need to be perfectly accurate, so locking doesn't matter too much */
+int cm_FindFileType(cm_fid_t *fidp)
+{
+ long hash;
+ cm_scache_t *scp;
+
+ hash = CM_SCACHE_HASH(fidp);
+
+ osi_assert(fidp->cell != 0);
+
+ lock_ObtainWrite(&cm_scacheLock);
+ for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
+ if (cm_FidCmp(fidp, &scp->fid) == 0) {
+ /*scp->refCount++;*/
+ /*cm_AdjustLRU(scp);*/
+ lock_ReleaseWrite(&cm_scacheLock);
+ return scp->fileType;
+ }
+ }
+ lock_ReleaseWrite(&cm_scacheLock);
+ return NULL;
+}
#ifndef __CM_SCACHE_H_ENV__
#define __CM_SCACHE_H_ENV__ 1
+#ifdef DJGPP
+#include "largeint95.h"
+#endif /* DJGPP */
+
typedef struct cm_fid {
unsigned long cell;
unsigned long volume;
(fidp)->unique)) \
% cm_hashTableSize)
+#include "cm_conn.h"
+#include "cm_buf.h"
+
extern cm_scache_t cm_fakeSCache;
extern void cm_InitSCache(long);
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <winsock2.h>
+#include <nb30.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <osi.h>
#include <rx/rx.h>
-#include <nb30.h>
#include "afsd.h"
osi_rwlock_t cm_serverLock;
#ifndef __CM_SERVER_H_ENV__
#define __CM_SERVER_H_ENV__ 1
+#ifndef DJGPP
#include <winsock2.h>
+#else /* DJGPP */
+#include <netinet/in.h>
+#endif /* !DJGPP */
#include <osi.h>
/* pointed to by volumes and cells without holds; cm_serverLock is obtained
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif /* !DJGPP */
#include <malloc.h>
#include <string.h>
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#include <winsock2.h>
+#endif /* !DJGPP */
#include <string.h>
#include <malloc.h>
-#include <winsock2.h>
#include <osi.h>
#include <rx/rx.h>
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
-#include <stddef.h>
#include <winsock2.h>
+#endif /* !DJGPP */
+#include <stddef.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
* which makes the code a little verbose.
*/
if (oldDscp == newDscp) {
+ /* check for identical names */
+ if (strcmp(oldNamep, newNamep) == 0)
+ return CM_ERROR_RENAME_IDENTICAL;
+
oneDir = 1;
lock_ObtainMutex(&oldDscp->mx);
cm_dnlcRemove(oldDscp, oldNamep);
int hasTilde;
} cm_lookupSearch_t;
+#include "cm_dir.h"
+
typedef int (*cm_DirFuncp_t)(struct cm_scache *, struct cm_dirEntry *, void *,
osi_hyper_t *entryOffsetp);
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
-#include <string.h>
-#include <malloc.h>
#include <winsock2.h>
#include <nb30.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
+#include <string.h>
+#include <malloc.h>
#include <osi.h>
#include <rx/rx.h>
--- /dev/null
+#ifndef DOSDEFS_H
+#define DOSDEFS_H
+
+/* dos_ptr is the phys. addr. accepted by farpeek/farpoke functions, i.e.,
+ dos_ptr = segment * 16 + offset */
+#define dos_ptr unsigned long
+
+/* get/set structure member of a struct in DOS memory */
+#define get_dos_member_b(T, ptr, memb) _farpeekb(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb))
+#define get_dos_member_w(T, ptr, memb) _farpeekw(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb))
+#define get_dos_member_l(T, ptr, memb) _farpeekl(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb))
+
+#define set_dos_member_b(T, ptr, memb, val) \
+ _farpokeb(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb), val)
+#define set_dos_member_w(T, ptr, memb, val) \
+ _farpokew(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb), val)
+#define set_dos_member_l(T, ptr, memb, val) \
+ _farpokel(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb), val)
+
+typedef struct _filetime
+{
+ unsigned int dwLowDateTime;
+ unsigned int dwHighDateTime;
+} FILETIME;
+
+#define FILE_ACTION_ADDED 0x00000001
+#define FILE_ACTION_REMOVED 0x00000002
+#define FILE_ACTION_MODIFIED 0x00000003
+#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
+#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
+
+#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
+#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
+#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
+#define FILE_NOTIFY_CHANGE_SIZE 0x00000008
+#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
+#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
+#define FILE_NOTIFY_CHANGE_CREATION 0x00000040
+#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
+
+#define ULONG unsigned long
+#define USHORT unsigned short
+#define WCHAR wchar_t
+
+#define GetTickCount gettime_ms
+#define GetCurrentTime gettime_ms
+
+#define lstrcpy strcpy
+#define strcmpi stricmp
+#define lstrlen strlen
+#define _stricmp stricmp
+#define _strlwr strlwr
+#define _strupr strupr
+
+#endif
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* functions for DJGPP to write to DOS memory or duplicate Win32 functions. */
+
+#include <stdio.h>
+#include <sys/farptr.h>
+#include <go32.h>
+#include <sys/time.h>
+#include "dosdefs95.h"
+
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+
+dos_memset(dos_ptr offset, int val, int size)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ {
+ _farpokeb(_dos_ds, offset++, val);
+ }
+}
+
+char *dos_strcpy_get(char *str, unsigned int offset)
+{
+ register char a;
+
+ while ((a = _farpeekb(_dos_ds, offset++)) != 0)
+ *str++ = a;
+ *str = 0;
+
+ return str;
+}
+
+char *dos_strncpy_get(char *str, unsigned int offset, int len)
+{
+ register char a;
+ register int n=0;
+
+ while ((a = _farpeekb(_dos_ds, offset++)) != 0 && n++ < len)
+ *str++ = a;
+ *str = 0;
+
+ return str;
+}
+
+dos_ptr dos_strcpy_put(dos_ptr offset, char *str)
+{
+ char a;
+
+ while ((a = *str++) != 0)
+ _farpokeb(_dos_ds, offset++, a);
+ _farpokeb(_dos_ds, offset, 0);
+
+ return offset;
+}
+
+dos_ptr dos_strncpy_put(dos_ptr offset, char *str, int len)
+{
+ register char a;
+ register int n=0;
+
+ while ((a = *str++) != 0 && n++ < len)
+ _farpokeb(_dos_ds, offset++, a);
+ _farpokeb(_dos_ds, offset, 0);
+
+ return offset;
+}
+
+dos_ptr dos_strrchr(dos_ptr offset, char c)
+{
+ dos_ptr temp = 0;
+ char a;
+
+ while ((a = _farpeekb(_dos_ds, offset++)) != 0)
+ {
+ if (a == c) temp = offset-1;
+ }
+
+ return temp;
+}
+
+int dos_strcmp(unsigned char *str, dos_ptr offset)
+{
+ register unsigned char a, b;
+
+ while (((a = *str++) == (b = _farpeekb(_dos_ds, offset++))) && a && b);
+ return a-b;
+}
+
+int dos_strncmp(unsigned char *str, dos_ptr offset, int len)
+{
+ register unsigned char a, b;
+ register int i=0;
+
+ while (i++ < len && ((a = *str++) == (b = _farpeekb(_dos_ds, offset++))) && a && b);
+ return a-b;
+}
+
+int dos_strlen(dos_ptr offset)
+{
+ int len=0;
+
+ while (_farpeekb(_dos_ds, offset++))
+ len++;
+
+ return len;
+}
+
+
+int sub_time(struct timeval a, struct timeval b)
+{
+ int n = a.tv_sec - b.tv_sec;
+ n *= 1000000;
+ n += a.tv_usec - b.tv_usec;
+ return n / 1000;
+}
+
+int tm_to_ms(struct timeval t)
+{
+ int n = t.tv_sec * 1000;
+ n += t.tv_usec / 1000;
+ return n;
+}
+
+int gettime_ms()
+{
+ struct timeval t;
+ int n = t.tv_sec * 1000;
+
+ gettimeofday(&t, NULL);
+ n += t.tv_usec / 1000;
+ return n;
+}
+
+int gettime_us()
+{
+ struct timeval t;
+ int n;
+
+ gettimeofday(&t, NULL);
+ n = t.tv_sec * 1000000;
+ n += t.tv_usec;
+ return n;
+}
+
+int GetPrivateProfileString(char *sect, char *key, char *def,
+ char *buf, int len, char *file)
+{
+ char s[256];
+ char skey[128];
+ int nchars=0;
+ int amt;
+ int offset;
+ char sectstr[256];
+ char *p;
+ FILE *f = fopen(file, "r");
+ if (!f) return 0;
+
+ sprintf(sectstr, "[%s]", sect);
+ while (1)
+ {
+ fgets(s, 256, f);
+ if (feof(f)) break;
+
+ /* look for section names */
+ if (s[0] != '[')
+ continue;
+
+ /* if sect is NULL, copy all section names */
+ if (!sect)
+ {
+ amt = MIN(strlen(s)+1, len-1);
+ strncpy(buf, s, amt-1);
+ buf[amt] = 0;
+ len -= amt;
+ buf += amt;
+ nchars += amt;
+ continue;
+ }
+
+ /* continue if non-matching section name */
+ if (sect && strnicmp(s+1, sect, strlen(sect)) != 0)
+ continue;
+
+ /* else we have the correct section */
+
+ while (len > 0)
+ {
+ fgets(s, 256, f);
+ if (feof(f)) break;
+
+ /* get the key part */
+ strcpy(skey, s);
+ p = strrchr(skey, '=');
+ if (!p) { fclose(f); return 0; }
+ *p = 0;
+
+ /* continue if key doesn't match */
+ if (key && stricmp(skey, key) != 0)
+ continue;
+
+ /* if NULL key, copy key names */
+ if (!key)
+ {
+ amt = MIN(strlen(skey)+1, len-2);
+ strncpy(buf, skey, amt);
+ buf[amt] = 0;
+ buf[amt+1] = 0; /* final trailing NULL */
+ len -= amt;
+ buf += amt;
+ nchars += amt;
+ continue;
+ }
+
+ /* discard key= and newline */
+ offset = strlen(key) + 1;
+ amt = MIN(strlen(s+offset)-1, len-1);
+ strncpy(buf, s+offset, amt);
+ buf[amt] = 0;
+ len -= amt;
+ buf += amt;
+ nchars += amt;
+ }
+ }
+
+ if (nchars == 0)
+ {
+ if (def)
+ {
+ strcpy(buf, def);
+ nchars = strlen(def);
+ }
+ }
+
+ fclose(f);
+ return nchars;
+}
+
+int WritePrivateProfileString(char *sect, char *key, char *str, char *file)
+{
+ char tmpfile[256], s[256], sectstr[256];
+ int found = 0;
+ char *p;
+ FILE *fr = fopen(file, "r");
+ FILE *fw = fopen(tmpfile, "w");
+
+ strcpy(tmpfile, file);
+ p = strrchr(tmpfile, '.');
+ *p = 0;
+ strcat(tmpfile, ".tmp"); /* change extension to .tmp */
+
+ sprintf(sectstr, "[%s]", sect);
+ while (1)
+ {
+ fgets(s, 256, fr);
+ if (feof(fr)) break;
+
+ fputs(s, fw);
+
+ /* look for section names */
+ if (found || s[0] != '[')
+ {
+ continue;
+ }
+
+ if (stricmp(s, sectstr) == 0)
+ {
+ /* found section, print new item */
+ found = 1;
+ strcpy(s, key);
+ strcat(s, "=");
+ strcat(s, str);
+ strcat(s, "\n");
+ fputs(s, fw);
+ }
+ }
+ fclose(fw);
+ fclose(fr);
+
+ /* delete old file */
+ remove(file);
+
+ /* rename .tmp */
+ rename(tmpfile, file);
+
+ return found;
+}
#include <afs/prs_fs.h>
#include <afs/pioctl_nt.h>
+#ifndef _MFC_VER
#include <winsock2.h>
+#endif
/* Fake error code since NT errno.h doesn't define it */
#include <afs/errmap_nt.h>
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* Large integer support for DJGPP */
+
+#include <stdlib.h>
+#include "largeint95.h"
+
+LARGE_INTEGER LargeIntegerAdd(LARGE_INTEGER a, LARGE_INTEGER b)
+{
+ LARGE_INTEGER c;
+ long long *c1 = (long long *) &c;
+ long long *a1 = (long long *) &a;
+ long long *b1 = (long long *) &b;
+ *c1 = *a1 + *b1;
+ return c;
+}
+
+LARGE_INTEGER LargeIntegerSubtract(LARGE_INTEGER a, LARGE_INTEGER b)
+{
+ LARGE_INTEGER c;
+ long long *c1 = (long long *) &c;
+ long long *a1 = (long long *) &a;
+ long long *b1 = (long long *) &b;
+ *c1 = *a1 - *b1;
+ return c;
+}
+
+LARGE_INTEGER ConvertLongToLargeInteger(unsigned long a)
+{
+ LARGE_INTEGER n;
+
+ n.LowPart = a;
+ n.HighPart = 0;
+ return n;
+}
+
+LARGE_INTEGER LargeIntegerMultiplyLongByLong(unsigned long a, unsigned long b)
+{
+ LARGE_INTEGER c;
+ long long *c1 = (long long *) &c;
+
+ *c1 = (long long) a * (long long) b;
+ return c;
+}
+
+LARGE_INTEGER LargeIntegerMultiplyByLong(LARGE_INTEGER a, unsigned long b)
+{
+ LARGE_INTEGER c;
+ long long *c1 = (long long *) &c;
+ long long *a1 = (long long *) &a;
+
+ *c1 = *a1 * (long long) b;
+ return c;
+}
+
+unsigned long LargeIntegerDivideByLong(LARGE_INTEGER a, unsigned long b)
+{
+ lldiv_t q;
+ long long *a1 = (long long *) &a;
+
+ q = lldiv(*a1, (long long) b);
+ return (unsigned long) q.quot;
+}
+
+#if 0
+LARGE_INTEGER LargeIntegerAdd(LARGE_INTEGER a, LARGE_INTEGER b)
+{
+ LARGE_INTEGER c;
+
+ c.LowPart = a.LowPart + b.LowPart;
+ c.HighPart = a.HighPart + b.HighPart;
+
+ /* not sure how to do a real carry */
+ if (c.LowPart < a.LowPart)
+ c.HighPart++;
+
+ return c;
+}
+
+LARGE_INTEGER LargeIntegerSubtract(LARGE_INTEGER a, LARGE_INTEGER b)
+{
+ LARGE_INTEGER c;
+
+ c.LowPart = a.LowPart - b.LowPart;
+ c.HighPart = a.HighPart - b.HighPart;
+
+ /* borrow */
+ if (c.LowPart > a.LowPart)
+ c.HighPart--;
+
+ return c;
+}
+
+__inline__ unsigned long mult32(unsigned long a, unsigned long b,
+ unsigned long *ov)
+{
+ unsigned long p, o;
+
+ /* multiply low part and save the overflow bits */
+ __asm__ __volatile__ ("movl %2, %%eax\n
+ mull %3, %%eax\n
+ movl %%eax, %0\n
+ movl %%edx, %1"
+ : "=g" (p), "=g" (o)
+ : "g" (a), "g" (b)
+ : "ax", "dx", "memory"
+ );
+ *ov = o;
+ return p;
+}
+
+__inline__ unsigned long div32(unsigned long a, unsigned long b,
+ unsigned long *rem)
+{
+ unsigned long q, r;
+
+ /* multiply low part and save the overflow bits */
+ __asm__ __volatile__ ("movl %2, %%eax\n
+ divl %3, %%eax\n
+ movl %%eax, %0\n
+ movl %%edx, %1"
+ : "=g" (q), "=g" (r)
+ : "g" (a), "g" (b)
+ : "ax", "dx", "memory"
+ );
+ *rem = r;
+ return q;
+}
+
+LARGE_INTEGER LargeIntegerMultiplyLongByLong(unsigned long a, unsigned long b)
+{
+ LARGE_INTEGER prod;
+
+ prod.LowPart = mult32(a, b, &prod.HighPart);
+ return prod;
+}
+
+LARGE_INTEGER LargeIntegerMultiplyByLong(LARGE_INTEGER a, unsigned long b)
+{
+ LARGE_INTEGER prod;
+ unsigned long x, prodl, prodh, ovl, ovh;
+
+ /* multiply low part and save the overflow bits */
+ prod.LowPart = mult32(a.LowPart, b, &ovl);
+
+ /* multiply high part */
+ prod.HighPart = mult32(a.HighPart, b, &ovh);
+
+ /* add overflow from low part */
+ prod.HighPart += ovl;
+
+ return prod;
+}
+
+unsigned long LargeIntegerDivideByLong(LARGE_INTEGER a, unsigned long b, unsigned long *rem)
+{
+ unsigned long n, r, q;
+ LARGE_INTEGER t;
+
+ if (b == 0) { return 0; }
+ if (b == 1) { *rem = 0; return a.LowPart; }
+
+ n = div32(a.LowPart, b, &r);
+ if (a.HighPart == 0)
+ {
+ *rem = r;
+ return n;
+ }
+ else
+ {
+ q = div32(0xffffffff-b+1, b, &r);
+ q++;
+ n += q * a.HighPart;
+ n += LargeIntegerDivideByLong(LargeIntegerMultiplyLongByLong(r, a.HighPart), b, rem);
+ return n;
+ }
+}
+#endif
+
+#if 0
+int LargeIntegerGreaterThan(LARGE_INTEGER a, LARGE_INTEGER b)
+{
+ if (a.HighPart > b.HighPart) return 1;
+ else if (a.HighPart == b.HighPart && a.LowPart > b.LowPart) return 1;
+ else return 0;
+}
+
+int LargeIntegerGreaterThanOrEqualTo(LARGE_INTEGER a, LARGE_INTEGER b)
+{
+ if (a.HighPart > b.HighPart) return 1;
+ else if (a.HighPart == b.HighPart && a.LowPart >= b.LowPart) return 1;
+ else return 0;
+}
+
+int LargeIntegerEqualTo(LARGE_INTEGER a, LARGE_INTEGER b)
+{
+ if (a.HighPart == b.HighPart && a.LowPart == b.LowPart) return 1;
+ else return 0;
+}
+
+int LargeIntegerGreaterOrEqualToZero(LARGE_INTEGER a)
+{
+ return ((a.HighPart & 0x8fffffff) ? 0 : 1);
+}
+
+int LargeIntegerLessThanZero(LARGE_INTEGER a)
+{
+ return ((a.HighPart & 0x8fffffff) ? 1 : 0);
+}
+#endif
--- /dev/null
+#ifndef LARGEINT_H
+#define LARGEINT_H
+
+typedef struct {
+ unsigned long LowPart;
+ unsigned long HighPart;
+} LARGE_INTEGER;
+
+LARGE_INTEGER LargeIntegerAdd(LARGE_INTEGER a, LARGE_INTEGER b);
+LARGE_INTEGER LargeIntegerSubtract(LARGE_INTEGER a, LARGE_INTEGER b);
+/*int LargeIntegerGreaterThan(LARGE_INTEGER a, LARGE_INTEGER b);
+int LargeIntegerGreaterThanOrEqualTo(LARGE_INTEGER a, LARGE_INTEGER b);
+int LargeIntegerEqualTo(LARGE_INTEGER a, LARGE_INTEGER b);
+int LargeIntegerGreaterOrEqualToZero(LARGE_INTEGER a);
+int LargeIntegerLessThanZero(LARGE_INTEGER a);*/
+LARGE_INTEGER ConvertLongToLargeInteger(unsigned long a);
+LARGE_INTEGER LargeIntegerMultiplyByLong(LARGE_INTEGER a, unsigned long b);
+unsigned long LargeIntegerDivideByLong(LARGE_INTEGER a, unsigned long b);
+
+#define LargeIntegerGreaterThan(a, b) \
+ ((a).HighPart > (b).HighPart || \
+ ((a).HighPart == (b).HighPart && (a).LowPart > (b).LowPart))
+
+#define LargeIntegerGreaterThanOrEqualTo(a, b) \
+ ((a).HighPart > (b).HighPart || \
+ ((a).HighPart == (b).HighPart && (a).LowPart >= (b).LowPart))
+
+#define LargeIntegerLessThan(a, b) \
+ ((a).HighPart < (b).HighPart || \
+ ((a).HighPart == (b).HighPart && (a).LowPart < (b).LowPart))
+
+#define LargeIntegerLessThanOrEqualTo(a, b) \
+ ((a).HighPart < (b).HighPart || \
+ ((a).HighPart == (b).HighPart && (a).LowPart <= (b).LowPart))
+
+#define LargeIntegerEqualTo(a, b) \
+ ((a).HighPart == (b).HighPart && (a).LowPart == (b).LowPart)
+
+#define LargeIntegerGreaterOrEqualToZero(a) ((a).HighPart >= 0)
+
+#define LargeIntegerLessThanZero(a) ((a).HighPart < 0)
+
+#define LargeIntegerNotEqualToZero(a) ((a).HighPart || (a).LowPart)
+
+#endif
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* Netbios function for DJGPP: calls interrupt 5Ch for Netbios function.
+ NCB and buffer space must be in DOS memory (below 1MB). */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <dpmi.h>
+#include <go32.h>
+#include "dosdefs95.h"
+#include "netbios95.h"
+
+extern int handler_seg, handler_off;
+
+int Netbios(NCB *Ncb, dos_ptr dos_ncb)
+{
+ __dpmi_regs regs;
+ int asynch = 1;
+ dos_ptr oldncb_buffer;
+
+#if 1
+ if (Ncb->ncb_command == NCBRESET ||
+ Ncb->ncb_command == NCBCANCEL ||
+ Ncb->ncb_command == NCBUNLINK ||
+ Ncb->ncb_command == NCBADDNAME ||
+ Ncb->ncb_command == NCBENUM ||
+ Ncb->ncb_command == NCBDELNAME) /* temp */
+ asynch = 0;
+#else
+ if (1)
+ asynch = 0;
+#endif
+ else
+ /* set to asynchronous */
+ Ncb->ncb_command |= ASYNCH;
+
+ /* adjust ncb_buffer pointer to be a segment:zero-offset pointer
+ for __dpmi_int */
+ oldncb_buffer = Ncb->ncb_buffer;
+ Ncb->ncb_buffer = Ncb->ncb_buffer << 12;
+
+ /*if (asynch)
+ Ncb->ncb_post = (handler_seg << 16) | handler_off;*/
+
+ /* copy to DOS space */
+ dosmemput(Ncb, sizeof(NCB), dos_ncb);
+
+ /* set address of NCB in registers */
+ memset(®s, 0, sizeof(regs));
+ regs.d.ebx = 0;
+ regs.x.ds = regs.x.es = dos_ncb/16;
+
+ __dpmi_int(0x5c,®s);
+ /*dosmemget(__tb, sizeof(NCB), Ncb);*/
+
+ if (asynch)
+ IOMGR_NCBSelect(Ncb, dos_ncb, NULL);
+
+ /* undo the change to ncb_buffer */
+ Ncb->ncb_buffer = oldncb_buffer;
+
+ return regs.x.ax;
+}
+
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef NETBIOS_H
+#define NETBIOS_H
+
+#define BYTE char
+#define WORD short
+
+#define NCBNAMSZ 16 /* absolute length of a net name */
+#define MAX_LANA 254 /* lana's in range 0 to MAX_LANA inclusive */
+
+#define MAX_COMPUTERNAME_LENGTH 15
+
+
+#define UCHAR unsigned char
+#define PUCHAR unsigned char *
+#define WORD short
+
+#include "osithrd95.h"
+
+typedef struct _NCB {
+ UCHAR ncb_command;
+ UCHAR ncb_retcode;
+ UCHAR ncb_lsn;
+ UCHAR ncb_num;
+ unsigned int ncb_buffer;
+ WORD ncb_length;
+ UCHAR ncb_callname[NCBNAMSZ];
+ UCHAR ncb_name[NCBNAMSZ];
+ UCHAR ncb_rto;
+ UCHAR ncb_sto;
+ int (*ncb_post)();
+ UCHAR ncb_lana_num;
+ UCHAR ncb_cmd_cplt;
+ UCHAR ncb_reserve[10];
+ UCHAR ncb_reserve2[4];
+ EVENT_HANDLE ncb_event;
+} NCB, *PNCB;
+
+
+#define NCBCALL 0x10
+#define NCBLISTEN 0x11
+#define NCBHANGUP 0x12
+#define NCBSEND 0x14
+#define NCBRECV 0x15
+#define NCBRECVANY 0x16
+#define NCBCHAINSEND 0x17
+#define NCBDGSEND 0x20
+#define NCBDGRECV 0x21
+#define NCBDGSENDBC 0x22
+#define NCBDGRECVBC 0x23
+#define NCBADDNAME 0x30
+#define NCBDELNAME 0x31
+#define NCBRESET 0x32
+#define NCBASTAT 0x33
+#define NCBSSTAT 0x34
+#define NCBCANCEL 0x35
+#define NCBADDGRNAME 0x36
+#define NCBENUM 0x37
+#define NCBUNLINK 0x70
+#define NCBSENDNA 0x71
+#define NCBCHAINSENDNA 0x72
+#define NCBLANSTALERT 0x73
+#define NCBACTION 0x77
+#define NCBFINDNAME 0x78
+#define NCBTRACE 0x79
+#define ASYNCH 0x80
+
+
+#define NRC_GOODRET 0x00
+#define NRC_BUFLEN 0x01
+#define NRC_ILLCMD 0x03
+#define NRC_CMDTMO 0x05
+#define NRC_INCOMP 0x06
+#define NRC_BADDR 0x07
+#define NRC_SNUMOUT 0x08
+#define NRC_NORES 0x09
+#define NRC_SCLOSED 0x0a
+#define NRC_CMDCAN 0x0b
+#define NRC_DUPNAME 0x0d
+#define NRC_NAMTFUL 0x0e
+#define NRC_ACTSES 0x0f
+#define NRC_LOCTFUL 0x11
+#define NRC_REMTFUL 0x12
+#define NRC_ILLNN 0x13
+#define NRC_NOCALL 0x14
+#define NRC_NOWILD 0x15
+#define NRC_INUSE 0x16
+#define NRC_NAMERR 0x17
+#define NRC_SABORT 0x18
+#define NRC_NAMCONF 0x19
+#define NRC_IFBUSY 0x21
+#define NRC_TOOMANY 0x22
+#define NRC_BRIDGE 0x23
+#define NRC_CANOCCR 0x24
+#define NRC_CANCEL 0x26
+#define NRC_DUPENV 0x30
+#define NRC_ENVNOTDEF 0x34
+#define NRC_OSRESNOTAV 0x35
+#define NRC_MAXAPPS 0x36
+#define NRC_NOSAPS 0x37
+#define NRC_NORESOURCES 0x38
+#define NRC_INVADDRESS 0x39
+#define NRC_INVDDID 0x3B
+#define NRC_LOCKFAIL 0x3C
+#define NRC_OPENERR 0x3f
+#define NRC_SYSTEM 0x40
+#define NRC_PENDING 0xff
+
+#endif /* NETBIOS_H */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* queue.c
+ *
+ * Generic queue for use with Windows 95/DJGPP disk cache
+ *
+ ************************************************************************/
+
+#ifdef DISKCACHE95
+
+#define NULL 0
+#include "queue95.h"
+#include <stdio.h>
+
+void QInit(Queue *queue)
+{
+ queue->head = NULL;
+ queue->tail = NULL;
+ queue->currpos = NULL;
+}
+
+void QAddT(Queue *queue, QLink* node, int ord)
+{
+ /*QLink* node = new QLink;*/
+
+ /*node->item = x;*/
+ node->ord = ord;
+ node->next = NULL;
+ node->prev = NULL;
+ if (!queue->tail)
+ queue->head = queue->tail = node;
+ else {
+ queue->tail->next = node;
+ queue->tail = node;
+ node->prev = queue->tail;
+ }
+ queue->size++;
+}
+
+void QAddH(Queue *queue, QLink *node, int ord)
+{
+ node->ord = ord;
+ node->next = NULL;
+ node->prev = NULL;
+ if (!queue->head)
+ queue->head = queue->tail = node;
+ else {
+ node->next = queue->head;
+ queue->head->prev = node;
+ queue->head = node;
+ }
+ queue->size++;
+}
+
+void QAddOrd(Queue *queue, QLink *node, int ord)
+{
+ /*QLink<T>* node = new QLink<T>;*/
+ QLink* p, *prev;
+
+ node->ord = ord;
+ node->next = NULL;
+ node->prev = NULL;
+ if (!queue->tail)
+ queue->head = queue->tail = node;
+ else {
+ p = queue->head;
+ while (p && ord >= p->ord) { /* add towards tail end if equals found */
+ prev = p;
+ p = p->next;
+ }
+ if (p == queue->head) {
+ QAddH(queue, node, ord);
+ }
+ else if (p == NULL) {
+ QAddT(queue, node, ord);
+ }
+ else {
+ node->next = p;
+ node->prev = prev;
+ prev->next = node;
+ }
+ }
+ queue->size++;
+}
+
+QLink* QServe(Queue *queue)
+{
+ QLink *n = queue->head;
+
+ if (!queue->head) return NULL;
+ if (queue->head == queue->tail)
+ queue->head = queue->tail = NULL;
+ else
+ queue->head = n->next;
+ queue->size--;
+ return n;
+}
+
+void QMoveToTail(Queue *queue, QLink *n, int ord)
+{
+ QRemove(queue, n);
+ QAddT(queue, n, ord);
+}
+
+void QRemove(Queue *queue, QLink *n)
+{
+ /*QLink* n2 = NULL;*/
+
+ if (!queue->head) return;
+ /*while(n && n != x) {
+ n2 = n;
+ n = n->next;
+ }*/
+ if (n == queue->currpos) {
+ if (n == queue->head) queue->currpos = n->next;
+ if (n == queue->tail) queue->currpos = n->prev;
+ if (n->prev) queue->currpos = n->prev;
+ }
+
+ if (n->prev)
+ {
+ /*assert(n->prev->next == n);*/
+ n->prev->next = n->next;
+ }
+ else
+ queue->head = n->next;
+
+ if (n->next)
+ {
+ /*assert(n->next->prev == n);*/
+ n->next->prev = n->prev;
+ }
+ else
+ queue->tail = n->prev;
+
+ queue->size--;
+}
+
+QLink *QCurrent(Queue *queue)
+{
+ /*if (currpos) return currpos->item;
+ else return NULL;*/
+ return queue->currpos;
+}
+
+void QIterate(Queue *queue)
+{
+ QLink* node;
+
+ node = queue->head;
+ while (node) {
+ printf("node=%x, ord=%f\n", node, node->ord);
+ node = node->next;
+ }
+ fflush(stdout);
+}
+
+#endif /* DISKCACHE95 */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* queue.h
+ *
+ * Class declaration for generic queue for use with Windows 95/DJGPP client
+ * disk cache
+ *
+ ***************************************************************************/
+
+#ifndef _QUEUE_H
+#define _QUEUE_H
+
+/* offset of member m in struct T */
+#define OFFSETOF(T, m) ((USHORT) &(((T *) NULL)->m))
+
+/* get pointer to parent struct T containing member m at address p */
+#define MEM_TO_OBJ(T, m, p) ((char *)(p) - OFFSETOF(T, m))
+
+typedef struct _QLink {
+ struct _QLink *next;
+ struct _QLink *prev;
+ int ord;
+} QLink;
+
+typedef struct _Queue {
+ QLink *head;
+ QLink *tail;
+ int size;
+ QLink *currpos;
+} Queue;
+
+/* add item to tail of queue */
+void QAddT(Queue *queue, QLink* node, int ord);
+
+/* add item to head of queue */
+void QAddH(Queue *queue, QLink *node, int ord);
+
+/* add item based on order value */
+void QAddOrd(Queue *queue, QLink *node, int ord);
+
+/* remove and return head of queue */
+QLink* QServe(Queue *queue);
+
+/* move item to tail of queue */
+void QMoveToTail(Queue *queue, QLink *x, int ord);
+
+/* remove item from queue */
+void QRemove(Queue *queue, QLink* x);
+
+/* return current position */
+QLink *QCurrent(Queue *queue);
+
+/* print out list of queued items */
+void QIterate(Queue *queue);
+
+#endif
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#else
+#include <sys/timeb.h>
+#include <tzfile.h>
+#endif /* !DJGPP */
#include <stddef.h>
#include <stdlib.h>
#include <malloc.h>
smb_user_t *loggedOutUserp = NULL;
unsigned long loggedOutTime;
int loggedOut = 0;
+#ifdef DJGPP
+int smbShutdownFlag = 0;
+#endif /* DJGPP */
int smb_LogoffTokenTransfer;
unsigned long smb_LogoffTransferTimeout;
osi_rwlock_t smb_rctLock;
unsigned char smb_LANadapter;
+unsigned char smb_sharename[NCBNAMSZ+1] = {0};
/* for debugging */
long smb_maxObsConcurrentCalls=0;
int numNCBs, numSessions;
#define NCBmax 100
-HANDLE NCBavails[NCBmax], NCBevents[NCBmax];
-HANDLE **NCBreturns;
+EVENT_HANDLE NCBavails[NCBmax], NCBevents[NCBmax];
+EVENT_HANDLE **NCBreturns;
DWORD NCBsessions[NCBmax];
NCB *NCBs[NCBmax];
struct smb_packet *bufs[NCBmax];
#define Sessionmax 100
-HANDLE SessionEvents[Sessionmax];
+EVENT_HANDLE SessionEvents[Sessionmax];
unsigned short LSNs[Sessionmax];
BOOL dead_sessions[Sessionmax];
/* for raw I/O */
osi_mutex_t smb_RawBufLock;
+#ifdef DJGPP
+#define SMB_RAW_BUFS 4
+dos_ptr smb_RawBufs;
+int smb_RawBufSel[SMB_RAW_BUFS];
+#else
char *smb_RawBufs;
+#endif /* DJGPP */
#define RAWTIMEOUT INFINITE
long code;
osi_hyper_t offset;
long count;
+#ifndef DJGPP
char *buf;
+#else
+ dos_ptr buf;
+#endif /* DJGPP */
int writeMode;
long alreadyWritten;
} raw_write_cont_t;
/* global state about V3 protocols */
int smb_useV3; /* try to negotiate V3 */
+#ifndef DJGPP
/* MessageBox or something like it */
int (WINAPI *smb_MBfunc)(HWND, LPCTSTR, LPCTSTR, UINT) = NULL;
+#endif /* DJGPP */
/* GMT time info:
* Time in Unix format of midnight, 1/1/1970 local time.
/* forward decl */
void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
NCB *ncbp, raw_write_cont_t *rwcp);
+void smb_NetbiosInit();
+extern char cm_HostName[];
+#ifdef DJGPP
+extern char cm_confDir[];
+#endif
+
+#ifdef DJGPP
+#define LPTSTR char *
+#define GetComputerName(str, sizep) \
+ strcpy((str), cm_HostName); \
+ *(sizep) = strlen(cm_HostName)
+#endif /* DJGPP */
/*
* Demo expiration
return (int)num;
}
+#ifndef DJGPP
void ShowUnixTime(char *FuncName, long unixTime)
{
FILETIME ft;
osi_Log1(afsd_logp, "%s", osi_LogSaveString(afsd_logp, msg));
}
}
+#endif /* DJGPP */
+#ifndef DJGPP
/* Determine if we are observing daylight savings time */
void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias)
{
*/
*pDST = localDST.wHour != local.wHour;
}
+#else
+/* Determine if we are observing daylight savings time */
+void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias)
+{
+ struct timeb t;
+
+ ftime(&t);
+ *pDST = t.dstflag;
+ *pDstBias = -60; /* where can this be different? */
+ *pBias = t.timezone;
+}
+#endif /* DJGPP */
+
void CompensateForSmbClientLastWriteTimeBugs(long *pLastWriteTime)
{
smb_NowTZ = seconds;
}
+
+#ifndef DJGPP
void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime)
{
struct tm *ltp;
SystemTimeToFileTime(&stm, largeTimep);
}
+#else /* DJGPP */
+void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime)
+{
+ /* unixTime: seconds since 1/1/1970 00:00:00 GMT */
+ /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 ??? */
+ LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep;
+ LARGE_INTEGER ut;
+ int leap_years = 89; /* leap years betw 1/1/1601 and 1/1/1970 */
+
+ /* set ft to number of 100ns intervals betw 1/1/1601 and 1/1/1970 GMT */
+ *ft = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years)
+ * 24 * 60);
+ *ft = LargeIntegerMultiplyByLong(*ft, 60);
+ *ft = LargeIntegerMultiplyByLong(*ft, 10000000);
+
+ /* add unix time */
+ ut = ConvertLongToLargeInteger(unixTime);
+ ut = LargeIntegerMultiplyByLong(ut, 10000000);
+ *ft = LargeIntegerAdd(*ft, ut);
+}
+#endif /* !DJGPP */
+#ifndef DJGPP
void smb_UnixTimeFromLargeSearchTime(long *unixTimep, FILETIME *largeTimep)
{
SYSTEMTIME stm;
*unixTimep = mktime(<);
_timezone = save_timezone;
}
+#else /* DJGPP */
+void smb_UnixTimeFromLargeSearchTime(long *unixTimep, FILETIME *largeTimep)
+{
+ /* unixTime: seconds since 1/1/1970 00:00:00 GMT */
+ /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 GMT? */
+ LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep;
+ LARGE_INTEGER a;
+ int leap_years = 89;
+
+ /* set to number of 100ns intervals betw 1/1/1601 and 1/1/1970 */
+ a = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) * 24 * 60
+);
+ a = LargeIntegerMultiplyByLong(a, 60);
+ a = LargeIntegerMultiplyByLong(a, 10000000);
+
+ /* subtract it from ft */
+ a = LargeIntegerSubtract(*ft, a);
+
+ /* divide down to seconds */
+ *unixTimep = LargeIntegerDivideByLong(a, 10000000);
+}
+#endif /* !DJGPP */
void smb_SearchTimeFromUnixTime(long *dosTimep, long unixTime)
{
int dosTime;
struct tm localJunk;
- ltp = localtime(&unixTime);
+ ltp = localtime((time_t*) &unixTime);
/* if we fail, make up something */
if (!ltp) {
void smb_UnixTimeFromDosUTime(long *unixTimep, long dosTime)
{
+#ifndef DJGPP
*unixTimep = dosTime + smb_localZero;
+#else /* DJGPP */
+ /* dosTime seems to be already adjusted for GMT */
+ *unixTimep = dosTime;
+#endif /* !DJGPP */
}
smb_vc_t *smb_FindVC(unsigned short lsn, int flags)
lock_InitializeMutex(&fidp->mx, "fid_t mutex");
fidp->fid = fid;
fidp->curr_chunk = fidp->prev_chunk = -2;
- fidp->raw_write_event = CreateEvent(NULL, FALSE, TRUE, NULL);
+ fidp->raw_write_event = thrd_CreateEvent(NULL, FALSE, TRUE, NULL);
if (newFid) {
vcp->fidCounter = fid+1;
if (vcp->fidCounter == 0) vcp->fidCounter = 1;
if (!(fidp->flags & SMB_FID_IOCTL))
scp = fidp->scp;
osi_QRemove((osi_queue_t **) &vcp->fidsp, &fidp->q);
- CloseHandle(fidp->raw_write_event);
+ thrd_CloseHandle(fidp->raw_write_event);
/* and see if there is ioctl stuff to free */
ioctlp = fidp->ioctlp;
char VNComputerName[] = "%COMPUTERNAME%";
char VNLCComputerName[] = "%LCCOMPUTERNAME%";
+/* List available shares */
+int smb_ListShares()
+{
+ char sbmtpath[256];
+ char pathName[256];
+ char shareBuf[4096];
+ int num_shares=0;
+ char *this_share;
+ int len;
+ char *p;
+ int print_afs = 0;
+ int code;
+
+ /*strcpy(shareNameList[num_shares], "all");
+ strcpy(pathNameList[num_shares++], "/afs");*/
+ fprintf(stderr, "The following shares are available:\n");
+ fprintf(stderr, "Share Name (AFS Path)\n");
+ fprintf(stderr, "---------------------\n");
+ fprintf(stderr, "\\\\%s\\%-16s (/afs)\n", smb_localNamep, "ALL");
+
+#ifndef DJGPP
+ code = GetWindowsDirectory(sbmtpath, sizeof(sbmtpath));
+ if (code == 0 || code > sizeof(sbmtpath)) return -1;
+#else
+ strcpy(sbmtpath, cm_confDir);
+#endif /* !DJGPP */
+ strcat(sbmtpath, "/afsdsbmt.ini");
+ len = GetPrivateProfileString("AFS Submounts", NULL, NULL,
+ shareBuf, sizeof(shareBuf),
+ sbmtpath);
+ if (len == 0) {
+ return num_shares;
+ }
+
+ this_share = shareBuf;
+ do
+ {
+ print_afs = 0;
+ /*strcpy(shareNameList[num_shares], this_share);*/
+ len = GetPrivateProfileString("AFS Submounts", this_share,
+ NULL,
+ pathName, 256,
+ sbmtpath);
+ if (!len) return num_shares;
+ p = pathName;
+ if (strncmp(p, "/afs", 4) != 0)
+ print_afs = 1;
+ while (*p) {
+ if (*p == '\\') *p = '/'; /* change to / */
+ p++;
+ }
+
+ fprintf(stderr, "\\\\%s\\%-16s (%s%s)\n",
+ smb_localNamep, this_share, (print_afs ? "/afs" : "\0"),
+ pathName);
+ num_shares++;
+ while (*this_share != NULL) this_share++; /* find next NULL */
+ this_share++; /* skip past the NULL */
+ } while (*this_share != NULL); /* stop at final NULL */
+
+ return num_shares;
+}
+
/* find a shareName in the table of submounts */
int smb_FindShare(smb_vc_t *vcp, smb_packet_t *inp, char *shareName,
char **pathNamep)
smb_user_t *uidp;
char temp[1024];
DWORD sizeTemp;
+ char sbmtpath[256];
+ char *p, *q;
if (strcmp(shareName, "IPC$") == 0) {
*pathNamep = NULL;
return 1;
}
+#ifndef DJGPP
+ strcpy(sbmtpath, "afsdsbmt.ini");
+#else /* DJGPP */
+ strcpy(sbmtpath, cm_confDir);
+ strcat(sbmtpath, "/afsdsbmt.ini");
+#endif /* !DJGPP */
len = GetPrivateProfileString("AFS Submounts", shareName, "",
- pathName, sizeof(pathName), "afsdsbmt.ini");
+ pathName, sizeof(pathName), sbmtpath);
if (len == 0 || len == sizeof(pathName) - 1) {
*pathNamep = NULL;
return 0;
}
+
+ /* We can accept either unix or PC style AFS pathnames. Convert
+ Unix-style to PC style here for internal use. */
+ p = pathName;
+ if (strncmp(p, "/afs", 4) == 0)
+ p += 4; /* skip /afs */
+ q = p;
+ while (*q) {
+ if (*q == '/') *q = '\\'; /* change to \ */
+ q++;
+ }
while (1)
{
- if (var = smb_stristr(pathName, VNUserName)) {
+ if (var = smb_stristr(p, VNUserName)) {
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
- smb_subst(pathName, var, sizeof(VNUserName),
+ smb_subst(p, var, sizeof(VNUserName),
uidp->name);
smb_ReleaseUID(uidp);
}
- else if (var = smb_stristr(pathName, VNLCUserName)) {
+ else if (var = smb_stristr(p, VNLCUserName)) {
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
strcpy(temp, uidp->name);
_strlwr(temp);
- smb_subst(pathName, var, sizeof(VNLCUserName), temp);
+ smb_subst(p, var, sizeof(VNLCUserName), temp);
smb_ReleaseUID(uidp);
}
- else if (var = smb_stristr(pathName, VNComputerName)) {
+ else if (var = smb_stristr(p, VNComputerName)) {
sizeTemp = sizeof(temp);
GetComputerName((LPTSTR)temp, &sizeTemp);
- smb_subst(pathName, var, sizeof(VNComputerName),
+ smb_subst(p, var, sizeof(VNComputerName),
temp);
}
- else if (var = smb_stristr(pathName, VNLCComputerName)) {
+ else if (var = smb_stristr(p, VNLCComputerName)) {
sizeTemp = sizeof(temp);
GetComputerName((LPTSTR)temp, &sizeTemp);
_strlwr(temp);
- smb_subst(pathName, var, sizeof(VNLCComputerName),
+ smb_subst(p, var, sizeof(VNLCComputerName),
temp);
}
else break;
}
- *pathNamep = strdup(pathName);
+ *pathNamep = strdup(p);
return 1;
}
static smb_packet_t *GetPacket(void)
{
smb_packet_t *tbp;
+#ifdef DJGPP
+ unsigned int npar, seg, tb_sel;
+#endif
+
lock_ObtainWrite(&smb_globalLock);
tbp = smb_packetFreeListp;
if (tbp) smb_packetFreeListp = tbp->nextp;
lock_ReleaseWrite(&smb_globalLock);
if (!tbp) {
+#ifndef DJGPP
tbp = GlobalAlloc(GMEM_FIXED, 65540);
+#else /* DJGPP */
+ tbp = malloc(sizeof(smb_packet_t));
+#endif /* !DJGPP */
tbp->magic = SMB_PACKETMAGIC;
tbp->ncbp = NULL;
tbp->vcp = NULL;
tbp->oddByte = 0;
tbp->ncb_length = 0;
tbp->flags = 0;
- }
+#ifdef DJGPP
+ npar = SMB_PACKETSIZE >> 4; /* number of paragraphs */
+ {
+ signed int retval =
+ __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */
+ if (retval == -1) {
+ afsi_log("Cannot allocate %d paragraphs of DOS memory",
+ npar);
+ osi_panic("",__FILE__,__LINE__);
+ }
+ else {
+ afsi_log("Allocated %d paragraphs of DOS mem at 0x%X",
+ npar, retval);
+ seg = retval;
+ }
+ }
+ tbp->dos_pkt = (seg * 16) + 0; /* DOS physical address */
+ tbp->dos_pkt_sel = tb_sel;
+#endif /* DJGPP */
+ }
osi_assert(tbp->magic == SMB_PACKETMAGIC);
return tbp;
smb_packet_t *tbp;
tbp = GetPacket();
memcpy(tbp, pkt, sizeof(smb_packet_t));
- tbp->wctp = tbp->data + (pkt->wctp - pkt->data);
+ tbp->wctp = tbp->data + ((unsigned int)pkt->wctp -
+ (unsigned int)pkt->data);
return tbp;
}
static NCB *GetNCB(void)
{
smb_ncb_t *tbp;
+ NCB *ncbp;
+#ifdef DJGPP
+ unsigned int npar, seg, tb_sel;
+#endif /* DJGPP */
+
lock_ObtainWrite(&smb_globalLock);
tbp = smb_ncbFreeListp;
if (tbp) smb_ncbFreeListp = tbp->nextp;
lock_ReleaseWrite(&smb_globalLock);
if (!tbp) {
+#ifndef DJGPP
tbp = GlobalAlloc(GMEM_FIXED, sizeof(*tbp));
+#else /* DJGPP */
+ tbp = malloc(sizeof(*tbp));
+ npar = (sizeof(NCB)+15) >> 4; /* number of paragraphs */
+ {
+ signed int retval =
+ __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */
+ if (retval == -1) {
+ afsi_log("Cannot allocate %d paragraphs of DOS mem in GetNCB",
+ npar);
+ osi_panic("",__FILE__,__LINE__);
+ } else {
+ afsi_log("Allocated %d paragraphs of DOS mem at 0x%X in GetNCB",
+ npar, retval);
+ seg = retval;
+ }
+ }
+ tbp->dos_ncb = (seg * 16) + 0; /* DOS physical address */
+ tbp->dos_ncb_sel = tb_sel;
+#endif /* !DJGPP */
tbp->magic = SMB_NCBMAGIC;
}
osi_assert(tbp->magic == SMB_NCBMAGIC);
memset(&tbp->ncb, 0, sizeof(NCB));
- return &tbp->ncb;
+ ncbp = &tbp->ncb;
+#ifdef DJGPP
+ dos_memset(tbp->dos_ncb, 0, sizeof(NCB));
+#endif /* DJGPP */
+ return ncbp;
}
void smb_FreePacket(smb_packet_t *tbp)
parmCount = *smbp->wctp;
if (parm >= parmCount) {
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
char s[100];
ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1006, NULL,
1, smbp->ncb_length, ptbuf, smbp);
DeregisterEventSource(h);
+#else /* DJGPP */
+ char s[100];
+
+ sprintf(s, "Bad SMB param %d out of %d, ncb len %d",
+ parm, parmCount, smbp->ncb_length);
+ osi_Log0(afsd_logp, s);
+#endif /* !DJGPP */
osi_panic(s, __FILE__, __LINE__);
}
parmDatap = smbp->wctp + (2*parm) + 1;
parmCount = *smbp->wctp;
if (parm * 2 + offset >= parmCount * 2) {
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
char s[100];
ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1006, NULL,
1, smbp->ncb_length, ptbuf, smbp);
DeregisterEventSource(h);
+#else /* DJGPP */
+ char s[100];
+
+ sprintf(s, "Bad SMB param %d offset %d out of %d, "
+ "ncb len %d",
+ parm, offset, parmCount, smbp->ncb_length);
+ osi_Log0(afsd_logp, s);
+#endif /* !DJGPP */
+
osi_panic(s, __FILE__, __LINE__);
}
parmDatap = smbp->wctp + (2*parm) + 1 + offset;
long code;
unsigned char *tp;
int localNCB = 0;
+#ifdef DJGPP
+ dos_ptr dos_ncb;
+#endif /* DJGPP */
ncbp = inp->ncbp;
if (ncbp == NULL) {
ncbp = GetNCB();
localNCB = 1;
}
+#ifdef DJGPP
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
+
memset((char *)ncbp, 0, sizeof(NCB));
extra = 2 * (*inp->wctp); /* space used by parms, in bytes */
tp = inp->wctp + 1+ extra; /* points to count of data bytes */
extra += tp[0] + (tp[1]<<8);
- extra += (inp->wctp - inp->data); /* distance to last wct field */
+ extra += ((unsigned int)inp->wctp - (unsigned int)inp->data); /* distance to last wct field */
extra += 3; /* wct and length fields */
ncbp->ncb_length = extra; /* bytes to send */
ncbp->ncb_lsn = (unsigned char) vcp->lsn; /* vc to use */
ncbp->ncb_lana_num = smb_LANadapter;
ncbp->ncb_command = NCBSEND; /* op means send data */
+#ifndef DJGPP
ncbp->ncb_buffer = (char *) inp;/* packet */
-
code = Netbios(ncbp);
+#else /* DJGPP */
+ ncbp->ncb_buffer = inp->dos_pkt;/* packet */
+ ((smb_ncb_t*)ncbp)->orig_pkt = inp;
+
+ /* copy header information from virtual to DOS address space */
+ dosmemput((char*)inp, SMB_PACKETSIZE, inp->dos_pkt);
+ code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+
if (code != 0)
osi_Log1(afsd_logp, "SendPacket failure code %d", code);
class = 1;
error = 18; /* no files in search */
}
+ else if (code == CM_ERROR_RENAME_IDENTICAL) {
+ class = 1;
+ error = 183; /* Samba uses this */
+ }
else {
class = 2;
error = 1;
smb_fid_t *fidp;
long code;
cm_user_t *userp = NULL;
- char *rawBuf;
- NCB *ncbp;
+ NCB *ncbp;
+ int rc;
+#ifndef DJGPP
+ char *rawBuf = NULL;
+#else
+ dos_ptr rawBuf = NULL;
+ dos_ptr dos_ncb;
+#endif /* DJGPP */
rawBuf = NULL;
finalCount = 0;
if (!fidp)
goto send1;
- if (fidp->flags & SMB_FID_IOCTL)
- return smb_IoctlReadRaw(fidp, vcp, inp, outp);
-
- userp = smb_GetUser(vcp, inp);
-
lock_ObtainMutex(&smb_RawBufLock);
if (smb_RawBufs) {
/* Get a raw buf, from head of list */
rawBuf = smb_RawBufs;
+#ifndef DJGPP
smb_RawBufs = *(char **)smb_RawBufs;
+#else /* DJGPP */
+ smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs);
+#endif /* !DJGPP */
}
lock_ReleaseMutex(&smb_RawBufLock);
if (!rawBuf)
- goto send;
+ goto send1a;
+
+ if (fidp->flags & SMB_FID_IOCTL)
+ {
+#ifndef DJGPP
+ rc = smb_IoctlReadRaw(fidp, vcp, inp, outp);
+#else
+ rc = smb_IoctlReadRaw(fidp, vcp, inp, outp, rawBuf);
+#endif
+ if (rawBuf) {
+ /* Give back raw buffer */
+ lock_ObtainMutex(&smb_RawBufLock);
+#ifndef DJGPP
+ *((char **) rawBuf) = smb_RawBufs;
+#else /* DJGPP */
+ _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+#endif /* !DJGPP */
+
+ smb_RawBufs = rawBuf;
+ lock_ReleaseMutex(&smb_RawBufLock);
+ }
+ return rc;
+ }
+
+ userp = smb_GetUser(vcp, inp);
+#ifndef DJGPP
code = smb_ReadData(fidp, &offset, count, rawBuf, userp, &finalCount);
+#else /* DJGPP */
+ /* have to give ReadData flag so it will treat buffer as DOS mem. */
+ code = smb_ReadData(fidp, &offset, count, (unsigned char *)rawBuf,
+ userp, &finalCount, TRUE /* rawFlag */);
+#endif /* !DJGPP */
+
if (code != 0)
goto send;
send:
+ cm_ReleaseUser(userp);
+send1a:
smb_ReleaseFID(fidp);
- cm_ReleaseUser(userp);
send1:
ncbp = outp->ncbp;
+#ifdef DJGPP
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
memset((char *)ncbp, 0, sizeof(NCB));
ncbp->ncb_length = (unsigned short) finalCount;
ncbp->ncb_command = NCBSEND;
ncbp->ncb_buffer = rawBuf;
+#ifndef DJGPP
code = Netbios(ncbp);
+#else /* DJGPP */
+ code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
if (code != 0)
osi_Log1(afsd_logp, "ReadRaw send failure code %d", code);
if (rawBuf) {
/* Give back raw buffer */
lock_ObtainMutex(&smb_RawBufLock);
+#ifndef DJGPP
*((char **) rawBuf) = smb_RawBufs;
+#else /* DJGPP */
+ _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+#endif /* !DJGPP */
+
smb_RawBufs = rawBuf;
lock_ReleaseMutex(&smb_RawBufLock);
}
int NTProtoIndex;
int protoIndex; /* index we're using */
int namex;
- long dbytes;
+ int dbytes;
int entryLength;
int tcounter;
char protocol_array[10][1024]; /* protocol signature of the client */
while(1) {
count++;
- Sleep(10000);
+ thrd_Sleep(10000);
if ((count % 360) == 0) /* every hour */
smb_CalculateNowTZ();
/* XXX GC dir search entries */
nwL = smb_allWaitingLocks;
if (nwL == NULL) {
osi_SleepW((long)&smb_allWaitingLocks, &smb_globalLock);
- Sleep(1000);
+ thrd_Sleep(1000);
continue;
}
else first = 1;
FreeNCB(ncbp);
free(wL);
} while (nwL);
- Sleep(1000);
+ thrd_Sleep(1000);
}
}
/* pull pathname and stat block out of request */
tp = smb_GetSMBData(inp, NULL);
- pathp = smb_ParseASCIIBlock(tp, &tp);
+ pathp = smb_ParseASCIIBlock(tp, (char **) &tp);
osi_assert(pathp != NULL);
- statBlockp = smb_ParseVblBlock(tp, &tp, &statLen);
+ statBlockp = smb_ParseVblBlock(tp, (char **) &tp, &statLen);
osi_assert(statBlockp != NULL);
if (statLen == 0) {
statBlockp = initStatBlock;
int maxCount;
smb_dirListPatch_t *dirListPatchesp;
smb_dirListPatch_t *curPatchp;
- long dataLength;
+ int dataLength;
cm_buf_t *bufferp;
long temp;
osi_hyper_t dirLength;
int caseFold;
char *tidPathp;
cm_req_t req;
+ cm_fid_t fid;
+ int fileType;
cm_InitReq(&req);
/* this is one of the entries to use: it is not deleted
* and it matches the star pattern we're looking for.
*/
+
+ /* Eliminate entries that don't match requested
+ attributes */
+ if (!(dsp->attribute & 0x10)) /* no directories */
+ {
+ /* We have already done the cm_TryBulkStat above */
+ fid.cell = scp->fid.cell;
+ fid.volume = scp->fid.volume;
+ fid.vnode = ntohl(dep->fid.vnode);
+ fid.unique = ntohl(dep->fid.unique);
+ fileType = cm_FindFileType(&fid);
+ osi_Log2(afsd_logp, "smb_ReceiveCoreSearchDir: file %s "
+ "has filetype %d", dep->name,
+ fileType);
+ if (fileType == CM_SCACHETYPE_DIRECTORY)
+ goto nextEntry;
+ }
+
*op++ = resByte;
memcpy(op, mask, 11); op += 11;
*op++ = (char) dsp->cookie; /* they say it must be non-zero */
int any;
} smb_unlinkRock_t;
-long smb_UnlinkProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
+int smb_UnlinkProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
{
long code;
smb_unlinkRock_t *rockp;
char *newNamep; /* ptr to the new file's name */
} smb_renameRock_t;
-long smb_RenameProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
+int smb_RenameProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
{
long code;
smb_renameRock_t *rockp;
int any;
} smb_rmdirRock_t;
-long smb_RmdirProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
+int smb_RmdirProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
{
long code;
smb_rmdirRock_t *rockp;
char *fullName;
};
-long smb_FullNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp,
+int smb_FullNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp,
osi_hyper_t *offp)
{
char shortName[13];
/* Don't jump the gun on an async raw write */
while (fidp->raw_writers) {
lock_ReleaseMutex(&fidp->mx);
- WaitForSingleObject(fidp->raw_write_event, RAWTIMEOUT);
+ thrd_WaitForSingleObject_Event(fidp->raw_write_event, RAWTIMEOUT);
lock_ObtainMutex(&fidp->mx);
}
/*
* smb_ReadData -- common code for Read, Read And X, and Raw Read
*/
+#ifndef DJGPP
long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
cm_user_t *userp, long *readp)
+#else /* DJGPP */
+long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
+ cm_user_t *userp, long *readp, int dosflag)
+#endif /* !DJGPP */
{
osi_hyper_t offset;
long code;
if (nbytes > count) nbytes = count; /* don't go past EOF */
/* now copy the data */
+#ifdef DJGPP
+ if (dosflag)
+ dosmemput(bufferp->datap + bufIndex, nbytes, (dos_ptr)op);
+ else
+#endif /* DJGPP */
memcpy(op, bufferp->datap + bufIndex, nbytes);
/* adjust counters, pointers, etc. */
/*
* smb_WriteData -- common code for Write and Raw Write
*/
+#ifndef DJGPP
long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
cm_user_t *userp, long *writtenp)
+#else /* DJGPP */
+long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
+ cm_user_t *userp, long *writtenp, int dosflag)
+#endif /* !DJGPP */
{
osi_hyper_t offset;
long code;
if (nbytes > count) nbytes = count; /* don't go past end of request */
/* now copy the data */
+#ifdef DJGPP
+ if (dosflag)
+ dosmemget((dos_ptr)op, nbytes, bufferp->datap + bufIndex);
+ else
+#endif /* DJGPP */
memcpy(bufferp->datap + bufIndex, op, nbytes);
buf_SetDirty(bufferp);
cm_user_t *userp;
cm_attr_t truncAttr; /* attribute struct used for truncating file */
char *op;
- long inDataBlockCount;
+ int inDataBlockCount;
fd = smb_GetSMBParm(inp, 0);
count = smb_GetSMBParm(inp, 1);
fidp->scp->clientModTime = time(NULL);
}
+#ifndef DJGPP
code = smb_WriteData(fidp, &offset, count, op, userp, &written);
+#else /* DJGPP */
+ code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE);
+#endif /* !DJGPP */
if (code == 0 && written < count)
code = CM_ERROR_PARTIALWRITE;
unsigned short fd;
smb_fid_t *fidp;
cm_user_t *userp;
+#ifndef DJGPP
char *rawBuf;
- int written = 0;
+#else /* DJGPP */
+ dos_ptr rawBuf;
+#endif /* !DJGPP */
+ long written = 0;
long code;
fd = smb_GetSMBParm(inp, 0);
userp = smb_GetUser(vcp, inp);
+#ifndef DJGPP
rawBuf = rwcp->buf;
-
code = smb_WriteData(fidp, &rwcp->offset, rwcp->count, rawBuf, userp,
&written);
+#else /* DJGPP */
+ rawBuf = (dos_ptr) rwcp->buf;
+ code = smb_WriteData(fidp, &rwcp->offset, rwcp->count,
+ (unsigned char *) rawBuf, userp,
+ &written, TRUE);
+#endif /* !DJGPP */
if (rwcp->writeMode & 0x1) { /* synchronous */
smb_t *op;
lock_ObtainMutex(&fidp->mx);
fidp->raw_writers--;
if (fidp->raw_writers == 0)
- SetEvent(fidp->raw_write_event);
+ thrd_SetEvent(fidp->raw_write_event);
lock_ReleaseMutex(&fidp->mx);
}
/* Give back raw buffer */
lock_ObtainMutex(&smb_RawBufLock);
+#ifndef DJGPP
*((char **)rawBuf) = smb_RawBufs;
+#else /* DJGPP */
+ _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+#endif /* !DJGPP */
smb_RawBufs = rawBuf;
lock_ReleaseMutex(&smb_RawBufLock);
cm_user_t *userp;
char *op;
unsigned short writeMode;
+#ifndef DJGPP
char *rawBuf;
+#else /* DJGPP */
+ dos_ptr rawBuf;
+#endif /* !DJGPP */
fd = smb_GetSMBParm(inp, 0);
totalCount = smb_GetSMBParm(inp, 1);
fidp->scp->clientModTime = time(NULL);
}
+#ifndef DJGPP
code = smb_WriteData(fidp, &offset, count, op, userp, &written);
+#else /* DJGPP */
+ code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE);
+#endif /* !DJGPP */
if (code == 0 && written < count)
code = CM_ERROR_PARTIALWRITE;
if (smb_RawBufs) {
/* Get a raw buf, from head of list */
rawBuf = smb_RawBufs;
+#ifndef DJGPP
smb_RawBufs = *(char **)smb_RawBufs;
+#else /* DJGPP */
+ smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs);
+#endif /* !DJGPP */
}
else
code = CM_ERROR_USESTD;
if (code == 0 && (writeMode & 1) == 0) {
lock_ObtainMutex(&fidp->mx);
fidp->raw_writers++;
- ResetEvent(fidp->raw_write_event);
+ thrd_ResetEvent(fidp->raw_write_event);
lock_ReleaseMutex(&fidp->mx);
}
*op++ = (unsigned char) (count & 0xff);
*op++ = (unsigned char) ((count >> 8) & 0xff);
+#ifndef DJGPP
code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount);
+#else /* DJGPP */
+ code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE);
+#endif /* !DJGPP */
/* fix some things up */
smb_SetSMBParm(outp, 0, finalCount);
/* Sanity check */
if (ncbp->ncb_length < offsetof(struct smb, vdata)) {
/* log it and discard it */
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
char s[100];
ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1007, NULL,
1, ncbp->ncb_length, ptbuf, inp);
DeregisterEventSource(h);
+#else /* DJGPP */
+ osi_Log1(smb_logp, "SMB message too short, len %d",
+ ncbp->ncb_length);
+#endif /* !DJGPP */
+
return;
}
/* We are an ongoing op */
- InterlockedIncrement(&ongoingOps);
+ thrd_Increment(&ongoingOps);
/* set up response packet for receiving output */
if (!(outp->flags & SMB_PACKETFLAG_SUSPENDED))
code = (*(dp->procp)) (vcp, inp, outp);
if (oldGen != sessionGen) {
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
char s[100];
ReportEvent(h, EVENTLOG_WARNING_TYPE, 0,
1005, NULL, 1, ncbp->ncb_length, ptbuf, smbp);
DeregisterEventSource(h);
+#else /* DJGPP */
+ osi_Log1(afsd_logp, "Pkt straddled session startup, "
+ "ncb length %d", ncbp->ncb_length);
+#endif /* !DJGPP */
}
}
else {
/* bad opcode, fail the request, after displaying it */
+#ifndef DJGPP
if (showErrors) {
sprintf(tbuffer, "Received bad SMB req 0x%x", inp->inCom);
code = (*smb_MBfunc)(NULL, tbuffer, "Cancel: don't show again",
MB_OKCANCEL);
if (code == IDCANCEL) showErrors = 0;
}
+#endif /* DJGPP */
code = CM_ERROR_BADOP;
}
/* catastrophic failure: log as much as possible */
if (code == CM_ERROR_BADSMB) {
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
char s[100];
ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1002, NULL,
1, ncbp->ncb_length, ptbuf, smbp);
DeregisterEventSource(h);
+#else /* DJGPP */
+ osi_Log1(afsd_logp, "Invalid SMB message, length %d",
+ ncbp->ncb_length);
+#endif /* !DJGPP */
code = CM_ERROR_INVAL;
}
if (outp->flags & SMB_PACKETFLAG_NOSEND) {
- InterlockedDecrement(&ongoingOps);
+ thrd_Decrement(&ongoingOps);
return;
}
/* tp now points to the new output record; go back and patch the
* second parameter (off2) to point to the new record.
*/
- temp = tp - ((char *) outp->data);
+ temp = (unsigned int)tp - ((unsigned int) outp->data);
outWctp[3] = (unsigned char) (temp & 0xff);
outWctp[4] = (unsigned char) ((temp >> 8) & 0xff);
outWctp[2] = 0; /* padding */
/* now send the output packet, and return */
if (!noSend)
smb_SendPacket(vcp, outp);
- InterlockedDecrement(&ongoingOps);
+ thrd_Decrement(&ongoingOps);
if (!(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) {
active_vcp = vcp;
return;
}
+#ifndef DJGPP
/* Wait for Netbios() calls to return, and make the results available to server
* threads. Note that server threads can't wait on the NCBevents array
* themselves, because NCB events are manual-reset, and the servers would race
DWORD code, idx;
while (1) {
- code = WaitForMultipleObjects(numNCBs, NCBevents,
+ code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBevents,
FALSE, INFINITE);
if (code == WAIT_OBJECT_0)
continue;
idx = code - WAIT_OBJECT_0;
- ResetEvent(NCBevents[idx]);
- SetEvent(NCBreturns[0][idx]);
+ thrd_ResetEvent(NCBevents[idx]);
+ thrd_SetEvent(NCBreturns[0][idx]);
}
}
+#endif /* !DJGPP */
/*
* Try to have one NCBRECV request waiting for every live session. Not more
{
DWORD code, idx_session, idx_NCB;
NCB *ncbp;
+#ifdef DJGPP
+ dos_ptr dos_ncb;
+#endif /* DJGPP */
while (1) {
/* Get a session */
- code = WaitForMultipleObjects(numSessions, SessionEvents,
- FALSE, INFINITE);
+ code = thrd_WaitForMultipleObjects_Event(numSessions, SessionEvents,
+ FALSE, INFINITE);
if (code == WAIT_OBJECT_0)
continue;
idx_session = code - WAIT_OBJECT_0;
/* Get an NCB */
NCBretry:
- code = WaitForMultipleObjects(numNCBs, NCBavails,
- FALSE, INFINITE);
+ code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBavails,
+ FALSE, INFINITE);
if (code == WAIT_OBJECT_0)
goto NCBretry;
idx_NCB = code - WAIT_OBJECT_0;
/* Fire it up */
ncbp = NCBs[idx_NCB];
+#ifdef DJGPP
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
ncbp->ncb_lsn = (unsigned char) LSNs[idx_session];
ncbp->ncb_command = NCBRECV | ASYNCH;
ncbp->ncb_lana_num = smb_LANadapter;
+#ifndef DJGPP
ncbp->ncb_buffer = (unsigned char *) bufs[idx_NCB];
- ncbp->ncb_length = SMB_PACKETSIZE;
ncbp->ncb_event = NCBevents[idx_NCB];
+ ncbp->ncb_length = SMB_PACKETSIZE;
Netbios(ncbp);
+#else /* DJGPP */
+ ncbp->ncb_buffer = bufs[idx_NCB]->dos_pkt;
+ ((smb_ncb_t*)ncbp)->orig_pkt = bufs[idx_NCB];
+ ncbp->ncb_event = NCBreturns[0][idx_NCB];
+ ncbp->ncb_length = SMB_PACKETSIZE;
+ Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
}
}
UCHAR rc;
smb_vc_t *vcp;
smb_t *smbp;
+#ifdef DJGPP
+ dos_ptr dos_ncb;
+#endif /* DJGPP */
outncbp = GetNCB();
outbufp = GetPacket();
(*smb_MBfunc)(NULL, "AFS demo expiration",
"afsd dispatcher",
MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
- ExitThread(1);
+ trhd_Exit(1);
}
}
#endif /* !NOEXPIRE */
- code = WaitForMultipleObjects(numNCBs, NCBreturns[myIdx],
- FALSE, INFINITE);
+ code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBreturns[myIdx],
+ FALSE, INFINITE);
if (code == WAIT_OBJECT_0)
continue;
idx_NCB = code - WAIT_OBJECT_0;
ncbp = NCBs[idx_NCB];
+#ifdef DJGPP
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
idx_session = NCBsessions[idx_NCB];
rc = ncbp->ncb_retcode;
case NRC_INCOMP:
/* Treat as transient error */
{
- HANDLE h;
+#ifndef DJGPP
+ EVENT_HANDLE h;
char *ptbuf[1];
char s[100];
ncbp->ncb_length, ptbuf,
bufp);
DeregisterEventSource(h);
+#else /* DJGPP */
+ osi_Log1(smb_logp,
+ "dispatch smb recv failed, message incomplete, ncb_length %d",
+ ncbp->ncb_length);
+ osi_Log1(smb_logp,
+ "SMB message incomplete, "
+ "length %d", ncbp->ncb_length);
+#endif /* !DJGPP */
+
/*
* We used to discard the packet.
* Instead, try handling it normally.
if (vcp->errorCount++ > 3)
dead_sessions[idx_session] = TRUE;
else {
- Sleep(1000);
- SetEvent(SessionEvents[idx_session]);
+ thrd_Sleep(1000);
+ thrd_SetEvent(SessionEvents[idx_session]);
}
continue;
}
vcp = smb_FindVC(ncbp->ncb_lsn, 0);
vcp->errorCount = 0;
bufp = (struct smb_packet *) ncbp->ncb_buffer;
+#ifdef DJGPP
+ bufp = ((smb_ncb_t *) ncbp)->orig_pkt;
+ /* copy whole packet to virtual memory */
+ /*fprintf(stderr, "smb_Server: copying dos packet at 0x%x, "
+ "bufp=0x%x\n",
+ bufp->dos_pkt / 16, bufp);*/
+ fflush(stderr);
+ dosmemget(bufp->dos_pkt, ncbp->ncb_length, bufp->data);
+#endif /* DJGPP */
smbp = (smb_t *)bufp->data;
outbufp->flags = 0;
if (smbp->com == 0x1d) {
/* Special handling for Write Raw */
raw_write_cont_t rwc;
- HANDLE rwevent;
+ EVENT_HANDLE rwevent;
smb_DispatchPacket(vcp, bufp, outbufp, ncbp, &rwc);
if (rwc.code == 0) {
- rwevent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
ncbp->ncb_command = NCBRECV | ASYNCH;
ncbp->ncb_lsn = (unsigned char) vcp->lsn;
ncbp->ncb_lana_num = smb_LANadapter;
ncbp->ncb_buffer = rwc.buf;
ncbp->ncb_length = 65535;
ncbp->ncb_event = rwevent;
+#ifndef DJGPP
Netbios(ncbp);
- rcode = WaitForSingleObject(rwevent,
- RAWTIMEOUT);
- CloseHandle(rwevent);
+#else
+ Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+ rcode = thrd_WaitForSingleObject_Event(rwevent,
+ RAWTIMEOUT);
+ thrd_CloseHandle(rwevent);
}
- SetEvent(SessionEvents[idx_session]);
+ thrd_SetEvent(SessionEvents[idx_session]);
if (rwc.code == 0)
smb_CompleteWriteRaw(vcp, bufp, outbufp, ncbp,
&rwc);
* (defect 11626)
*/
smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL);
- SetEvent(SessionEvents[idx_session]);
+ thrd_SetEvent(SessionEvents[idx_session]);
} else {
- SetEvent(SessionEvents[idx_session]);
+ thrd_SetEvent(SessionEvents[idx_session]);
smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL);
}
smb_concurrentCalls--;
doneWithNCB:
- SetEvent(NCBavails[idx_NCB]);
+ thrd_SetEvent(NCBavails[idx_NCB]);
}
}
void InitNCBslot(int idx)
{
struct smb_packet *bufp;
- HANDLE retHandle;
+ EVENT_HANDLE retHandle;
int i;
NCBs[idx] = GetNCB();
- NCBavails[idx] = CreateEvent(NULL, FALSE, TRUE, NULL);
- NCBevents[idx] = CreateEvent(NULL, TRUE, FALSE, NULL);
- retHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
+ NCBavails[idx] = thrd_CreateEvent(NULL, FALSE, TRUE, NULL);
+#ifndef DJGPP
+ NCBevents[idx] = thrd_CreateEvent(NULL, TRUE, FALSE, NULL);
+#endif /* !DJGPP */
+ retHandle = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
for (i=0; i<smb_NumServerThreads; i++)
NCBreturns[i][idx] = retHandle;
bufp = GetPacket();
char rname[NCBNAMSZ+1];
char cname[MAX_COMPUTERNAME_LENGTH+1];
int cnamelen = MAX_COMPUTERNAME_LENGTH+1;
+#ifdef DJGPP
+ dos_ptr dos_ncb;
+ time_t now;
+#endif /* DJGPP */
ncbp = GetNCB();
+#ifdef DJGPP
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
while (1) {
+#ifdef DJGPP
+ /* terminate if shutdown flag is set */
+ if (smbShutdownFlag == 1)
+ thrd_Exit(1);
+#endif /* DJGPP */
+
#ifndef NOEXPIRE
/* check for demo expiration */
{
ncbp->ncb_lana_num = smb_LANadapter;
+#ifndef DJGPP
code = Netbios(ncbp);
+#else /* DJGPP */
+ code = Netbios(ncbp, dos_ncb);
+
+ if (code != 0)
+ {
+ fprintf(stderr, "NCBLISTEN lana=%d (smb_LANadapter=%d) "
+ "failed with code %d\n",
+ ncbp->ncb_lana_num, smb_LANadapter, code);
+ osi_Log3(0, "NCBLISTEN lana=%d (smb_LANadapter=%d) "
+ "failed with code %d",
+ ncbp->ncb_lana_num, smb_LANadapter, code);
+ fprintf(stderr, "\nClient exiting due to network failure "
+ "(possibly due to power-saving mode)\n");
+ fprintf(stderr, "Please restart client.\n");
+ afs_exit(AFS_EXITCODE_NETWORK_FAILURE);
+ }
+#endif /* !DJGPP */
osi_assert(code == 0);
/* check for remote conns */
/* Log session startup */
if (reportSessionStartups) {
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
char s[100];
ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1004, NULL,
1, 0, ptbuf, NULL);
DeregisterEventSource(h);
+#else /* DJGPP */
+ afsi_log("NCBLISTEN completed, call from %s",rname);
+ osi_Log1(afsd_logp, "SMB session startup, %d ongoing o
+ps",
+ ongoingOps);
+ time(&now);
+ fprintf(stderr, "%s: New session starting from host %s
+\n",
+ asctime(localtime(&now)), rname);
+ fflush(stderr);
+#endif /* !DJGPP */
}
/* now ncbp->ncb_lsn is the connection ID */
/* Add new NCB for new session */
InitNCBslot(numNCBs);
numNCBs++;
- SetEvent(NCBavails[0]);
- SetEvent(NCBevents[0]);
+ thrd_SetEvent(NCBavails[0]);
+ thrd_SetEvent(NCBevents[0]);
for (j = 0; j < smb_NumServerThreads; j++)
- SetEvent(NCBreturns[j][0]);
+ thrd_SetEvent(NCBreturns[j][0]);
/* Also add new session event */
- SessionEvents[i] = CreateEvent(NULL, FALSE, TRUE, NULL);
+ SessionEvents[i] = thrd_CreateEvent(NULL, FALSE, TRUE, NULL);
numSessions++;
- SetEvent(SessionEvents[0]);
+ thrd_SetEvent(SessionEvents[0]);
} else {
- SetEvent(SessionEvents[i]);
+ thrd_SetEvent(SessionEvents[i]);
}
} /* dispatch while loop */
}
+/* initialize Netbios */
+void smb_NetbiosInit()
+{
+ NCB *ncbp;
+#ifdef DJGPP
+ dos_ptr dos_ncb;
+#endif /* DJGPP */
+ int i, lana, code;
+ char s[100];
+ int delname_tried=0;
+ int len;
+
+ /* setup the NCB system */
+ ncbp = GetNCB();
+#ifdef DJGPP
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
+
+#ifndef DJGPP
+ /* reset the adaptor: in Win32, this is required for every process, and
+ * acts as an init call, not as a real hardware reset.
+ */
+ ncbp->ncb_command = NCBRESET;
+ ncbp->ncb_callname[0] = 100;
+ ncbp->ncb_callname[2] = 100;
+ ncbp->ncb_lana_num = smb_LANadapter;
+ code = Netbios(ncbp);
+ if (code == 0) code = ncbp->ncb_retcode;
+ if (code != 0) {
+ sprintf(s, "Netbios NCBRESET error code %d", code);
+ afsi_log(s);
+ osi_panic(s, __FILE__, __LINE__);
+ }
+#endif /* !DJGPP */
+
+ try_addname:
+ /* and declare our name so we can receive connections */
+ memset(ncbp, 0, sizeof(*ncbp));
+ ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_command = NCBADDNAME;
+ strcpy(ncbp->ncb_name, smb_localNamep);
+ len = strlen(smb_localNamep);
+ for(i=len; i<NCBNAMSZ; i++) ncbp->ncb_name[i] = ' ';
+ /* Keep the name so we can unregister it later */
+ memcpy(smb_sharename,ncbp->ncb_name,NCBNAMSZ);
+ lana = smb_LANadapter;
+
+ do { /* try multiple LANA numbers until we find one that works */
+ ncbp->ncb_lana_num = lana;
+#ifndef DJGPP
+ code = Netbios(ncbp);
+#else /* DJGPP */
+ code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+
+ afsi_log("Netbios NCBADDNAME code=%d retcode=%d complete=%d",code,
+ ncbp->ncb_retcode,ncbp->ncb_cmd_cplt);
+ {
+ char name[200];
+ int i;
+ for (i=0;i<NCBNAMSZ;++i)
+ name[i] = ncbp->ncb_name[i];
+ name[i] = '\0';
+ afsi_log("Netbios NCBADDNAME added new name >%s<",name);
+ }
+
+ if (code == 0)
+ {
+ code = ncbp->ncb_retcode;
+ smb_LANadapter = lana; /* correct LANA number */
+ break;
+ }
+ else
+ {
+ sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code);
+ afsi_log(s);
+ if (code != NRC_BRIDGE) /* invalid LANA num */
+ break;
+ else
+ lana = (lana + 1) % 8;
+ }
+ } while (lana != smb_LANadapter); /* quit when we loop back to orig. */
+
+ if (code == NRC_DUPNAME)
+ {
+ /* Name already exists; try to delete it */
+ memset(ncbp, 0, sizeof(*ncbp));
+ ncbp->ncb_command = NCBDELNAME;
+ memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
+ ncbp->ncb_lana_num = smb_LANadapter;
+#ifndef DJGPP
+ code = Netbios(ncbp);
+#else
+ code = Netbios(ncbp, dos_ncb);
+#endif /* DJGPP */
+ if (code == 0) code = ncbp->ncb_retcode;
+ if (code != 0) {
+ fprintf(stderr, "Netbios NCBDELNAME error code %d", code);
+ }
+ fflush(stderr);
+ if (code == 0 && !delname_tried)
+ {
+ delname_tried = 1;
+ goto try_addname;
+ }
+ }
+
+ if (code != 0)
+ osi_panic(s, __FILE__, __LINE__);
+
+ fprintf(stderr, "Using LAN Adapter %d\n", smb_LANadapter, code);
+ afsi_log("Netbios NCBADDNAME lana=%d name number=%d", smb_LANadapter,
+ ncbp->ncb_num);
+
+ /* we're done with the NCB now */
+ FreeNCB(ncbp);
+}
+
void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
- int nThreads, void *aMBfunc)
+ int nThreads
+#ifndef DJGPP
+ , void *aMBfunc
+#endif
+ )
+
{
- HANDLE phandle;
- long lpid;
+ thread_t phandle;
+ int lpid;
int i;
long code;
int len;
NCB *ncbp;
struct tm myTime;
char s[100];
+#ifdef DJGPP
+ int npar, seg, sel;
+ dos_ptr rawBuf;
+#endif /* DJGPP */
+#ifndef DJGPP
smb_MBfunc = aMBfunc;
+#endif /* DJGPP */
#ifndef NOEXPIRE
/* check for demo expiration */
{
unsigned long tod = time((void *) 0);
if (tod > EXPIREDATE) {
+#ifndef DJGPP
(*smb_MBfunc)(NULL, "AFS demo expiration",
"afsd",
MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
exit(1);
+#else /* DJGPP */
+ fprintf(stderr, "AFS demo expiration\n");
+ afs_exit(0);
+#endif /* !DJGPP */
}
}
#endif /* !NOEXPIRE */
lock_InitializeMutex(&smb_RawBufLock, "smb raw buffer lock");
/* 4 Raw I/O buffers */
+#ifndef DJGPP
smb_RawBufs = GlobalAlloc(GMEM_FIXED, 65536);
*((char **)smb_RawBufs) = NULL;
for (i=0; i<3; i++) {
*((char **)rawBuf) = smb_RawBufs;
smb_RawBufs = rawBuf;
}
+#else /* DJGPP */
+ npar = 65536 >> 4; /* number of paragraphs */
+ seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[0]);
+ if (seg == -1) {
+ afsi_log("Cannot allocate %d paragraphs of DOS memory",
+ npar);
+ osi_panic("",__FILE__,__LINE__);
+ }
+ else {
+ afsi_log("Allocated %d paragraphs of DOS mem at 0x%X",
+ npar, seg);
+ }
+ smb_RawBufs = (seg * 16) + 0; /* DOS physical address */
+
+ _farpokel(_dos_ds, smb_RawBufs, NULL);
+ for (i=0; i<SMB_RAW_BUFS-1; i++) {
+ npar = 65536 >> 4; /* number of paragraphs */
+ seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[i+1]);
+ if (seg == -1) {
+ afsi_log("Cannot allocate %d paragraphs of DOS memory",
+ npar);
+ osi_panic("",__FILE__,__LINE__);
+ }
+ else {
+ afsi_log("Allocated %d paragraphs of DOS mem at 0x%X",
+ npar, seg);
+ }
+ rawBuf = (seg * 16) + 0; /* DOS physical address */
+ /*_farpokel(_dos_ds, smb_RawBufs, smb_RawBufs);*/
+ _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+ smb_RawBufs = rawBuf;
+ }
+#endif /* !DJGPP */
/* global free lists */
smb_ncbFreeListp = NULL;
smb_packetFreeListp = NULL;
- /* setup the NCB system */
- ncbp = GetNCB();
-
- /* reset the adaptor: in Win32, this is required for every process, and
- * acts as an init call, not as a real hardware reset.
- */
- ncbp->ncb_command = NCBRESET;
- ncbp->ncb_callname[0] = 100;
- ncbp->ncb_callname[2] = 100;
- ncbp->ncb_lana_num = smb_LANadapter;
- code = Netbios(ncbp);
- if (code == 0) code = ncbp->ncb_retcode;
- if (code != 0) {
- sprintf(s, "Netbios NCBRESET error code %d", code);
- afsi_log(s);
- osi_panic(s, __FILE__, __LINE__);
- }
-
- /* and declare our name so we can receive connections */
- memset(ncbp, 0, sizeof(*ncbp));
- ncbp->ncb_lana_num = smb_LANadapter;
- ncbp->ncb_command = NCBADDNAME;
- strncpy(ncbp->ncb_name, snamep, len);
- for(i=len; i<NCBNAMSZ; i++) ncbp->ncb_name[i] = ' ';
- code = Netbios(ncbp);
- if (code == 0) {
- code = ncbp->ncb_retcode;
- }
- if (code != 0) {
- afsi_log("Netbios NCBADDNAME error code %d", code);
- }
-
- /* we're done with the NCB now */
- FreeNCB(ncbp);
+ smb_NetbiosInit();
/* Initialize listener and server structures */
memset(dead_sessions, 0, sizeof(dead_sessions));
- SessionEvents[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ SessionEvents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
numSessions = 1;
smb_NumServerThreads = nThreads;
- NCBavails[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
- NCBevents[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
- NCBreturns = malloc(nThreads * sizeof(HANDLE *));
+ NCBavails[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
+ NCBevents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
+ NCBreturns = malloc(nThreads * sizeof(EVENT_HANDLE *));
for (i = 0; i < nThreads; i++) {
- NCBreturns[i] = malloc(NCBmax * sizeof(HANDLE));
- NCBreturns[i][0] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ NCBreturns[i] = malloc(NCBmax * sizeof(EVENT_HANDLE));
+ NCBreturns[i][0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
}
for (i = 1; i <= nThreads; i++)
InitNCBslot(i);
/* Start listeners, waiters, servers, and daemons */
- phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_Listener,
- NULL, 0, &lpid);
+ phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Listener,
+ NULL, 0, &lpid, "smb_Listener");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
- phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_ClientWaiter,
- NULL, 0, &lpid);
+#ifndef DJGPP
+ phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ClientWaiter,
+ NULL, 0, &lpid, "smb_ClientWaiter");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
+#endif /* !DJGPP */
- phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_ServerWaiter,
- NULL, 0, &lpid);
+ phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ServerWaiter,
+ NULL, 0, &lpid, "smb_ServerWaiter");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
for (i=0; i<nThreads; i++) {
- phandle = CreateThread(NULL, 65536,
- (LPTHREAD_START_ROUTINE) smb_Server,
- (void *) i, 0, &lpid);
+ phandle = thrd_Create(NULL, 65536,
+ (ThreadFunc) smb_Server,
+ (void *) i, 0, &lpid, "smb_Server");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
}
- phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_Daemon,
- NULL, 0, &lpid);
+ phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Daemon,
+ NULL, 0, &lpid, "smb_Daemon");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
- phandle = CreateThread(NULL, 65536,
- (LPTHREAD_START_ROUTINE) smb_WaitingLocksDaemon,
- NULL, 0, &lpid);
+ phandle = thrd_Create(NULL, 65536,
+ (ThreadFunc) smb_WaitingLocksDaemon,
+ NULL, 0, &lpid, "smb_WaitingLocksDaemon");
osi_assert(phandle != NULL);
- CloseHandle(phandle);
+ thrd_CloseHandle(phandle);
+
+#ifdef DJGPP
+ smb_ListShares();
+#endif
return;
}
+
+#ifdef DJGPP
+void smb_Shutdown(void)
+{
+ NCB *ncbp;
+ dos_ptr dos_ncb;
+ long code;
+ int i;
+
+ /*fprintf(stderr, "Entering smb_Shutdown\n");*/
+
+ /* setup the NCB system */
+ ncbp = GetNCB();
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+
+ /* Block new sessions by setting shutdown flag */
+ /*smbShutdownFlag = 1;*/
+
+ /* Hang up all sessions */
+ for (i = 1; i < numSessions; i++)
+ {
+ if (dead_sessions[i])
+ continue;
+
+ /*fprintf(stderr, "NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/
+ ncbp->ncb_command = NCBHANGUP;
+ ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lsn = LSNs[i];
+ code = Netbios(ncbp, dos_ncb);
+ /*fprintf(stderr, "returned from NCBHANGUP session %d LSN %d\n", i, LS
+ Ns[i]);*/
+ if (code == 0) code = ncbp->ncb_retcode;
+ if (code != 0) {
+ fprintf(stderr, "Session %d Netbios NCBHANGUP error code %d", i, code);
+ }
+ }
+
+ /* Delete Netbios name */
+ ncbp->ncb_command = NCBDELNAME;
+ memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
+ ncbp->ncb_lana_num = smb_LANadapter;
+ code = Netbios(ncbp, dos_ncb);
+ if (code == 0) code = ncbp->ncb_retcode;
+ if (code != 0) {
+ fprintf(stderr, "Netbios NCBDELNAME error code %d", code);
+ }
+ fflush(stderr);
+}
+#endif /* DJGPP */
#ifndef __SMB_H_ENV__
#define __SMB_H_ENV__ 1
+#ifdef DJGPP
+#include "netbios95.h"
+#endif /* DJGPP */
+
/* basic core protocol SMB structure */
typedef struct smb {
unsigned char id[4];
unsigned char oddByte;
unsigned short ncb_length;
unsigned char flags;
+#ifdef DJGPP
+ dos_ptr dos_pkt;
+ unsigned int dos_pkt_sel;
+#endif /* DJGPP */
} smb_packet_t;
/* smb_packet flags */
NCB ncb; /* ncb to use */
struct myncb *nextp; /* when on free list */
long magic;
+#ifdef DJGPP
+ dos_ptr dos_ncb;
+ smb_packet_t *orig_pkt;
+ unsigned int dos_ncb_sel;
+#endif /* DJGPP */
} smb_ncb_t;
/* structures representing environments from kernel / SMB network.
int curr_chunk; /* chunk being read */
int prev_chunk; /* previous chunk read */
int raw_writers; /* pending async raw writes */
- HANDLE raw_write_event; /* signal this when raw_writers zero */
+ EVENT_HANDLE raw_write_event; /* signal this when raw_writers zero */
} smb_fid_t;
#define SMB_FID_OPENREAD 1 /* open for reading */
* the response was already
* sent.
*/
+#define SMB_MAX_PATH 256 /* max path length */
/* prototypes */
extern void smb_Init(osi_log_t *logp, char *smbNamep, int useV3, int LANadapt,
- int nThreads, void *aMBfunc);
+ int nThreads
+#ifndef DJGPP
+ , void *aMBfunc
+#endif
+ );
extern void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime);
extern int smb_SUser(cm_user_t *userp);
+#ifndef DJGPP
extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
char *op, cm_user_t *userp, long *readp);
+#else /* DJGPP */
+extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
+ char *op, cm_user_t *userp, long *readp, int dosflag);
+#endif /* !DJGPP */
extern BOOL smb_IsLegalFilename(char *filename);
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif /* !DJGPP */
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
/* We sometimes see 0 word count. What to do? */
if (*inp->wctp == 0) {
+#ifndef DJGPP
HANDLE h;
char *ptbuf[1];
ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1003, NULL,
1, inp->ncb_length, ptbuf, inp);
DeregisterEventSource(h);
+#else /* DJGPP */
+ osi_Log0(afsd_logp, "TRANSACTION2 word count = 0");
+#endif /* !DJGPP */
smb_SetSMBDataLength(outp, 0);
smb_SendPacket(vcp, outp);
size_t shortNameLen;
};
-long cm_GetShortNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *vrockp,
+int cm_GetShortNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *vrockp,
osi_hyper_t *offp)
{
struct smb_ShortNameRock *rockp;
if (infoLevel == 0x108) {
code = cm_GetShortName((char *)(&p->parmsp[3]), userp, &req,
tidPathp, scp->fid.vnode, shortName,
- &len);
+ (size_t *) &len);
if (code) {
goto done;
}
char shortName[13]; /* 8.3 name if needed */
int NeedShortName;
char *shortNameEnd;
+ int fileType;
+ cm_fid_t fid;
cm_req_t req;
|| (NeedShortName
&& smb_V3MatchMask(shortName, maskp,
CM_FLAG_CASEFOLD)))) {
+
+ /* Eliminate entries that don't match requested
+ attributes */
+ if (!(dsp->attribute & 0x10)) /* no directories */
+ {
+ /* We have already done the cm_TryBulkStat above */
+ fid.cell = scp->fid.cell;
+ fid.volume = scp->fid.volume;
+ fid.vnode = ntohl(dep->fid.vnode);
+ fid.unique = ntohl(dep->fid.unique);
+ fileType = cm_FindFileType(&fid);
+ /*osi_Log2(afsd_logp, "smb_ReceiveTran2SearchDir: file %s "
+ "has filetype %d", dep->name,
+ fileType);*/
+ if (fileType == CM_SCACHETYPE_DIRECTORY)
+ goto nextEntry;
+ }
+
/* finally check if this name will fit */
/* standard dir entry stuff */
/* set the packet data length the count of the # of bytes */
smb_SetSMBDataLength(outp, count);
+#ifndef DJGPP
code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount);
+#else /* DJGPP */
+ code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE);
+#endif /* !DJGPP */
/* fix some things up */
smb_SetSMBParm(outp, 5, finalCount);
extern void smb3_Init();
+#ifdef DJGPP
+#define DELETE (0x00010000)
+#define READ_CONTROL (0x00020000)
+#define SYNCHRONIZE (0x00100000)
+#define FILE_WRITE_ATTRIBUTES ( 0x0100 )
+#define FILE_GENERIC_READ (0x00120089)
+#define FILE_GENERIC_WRITE (0x00120116)
+#define FILE_GENERIC_EXECUTE (0x001200a0)
+#endif /* DJGPP */
+
#endif /* __SMB3_H_ENV__ */
#define VIOC_LISTSYMLINK 0x24
#define VIOC_DELSYMLINK 0x25
#define VIOC_MAKESUBMOUNT 0x26
+#define VIOC_SHUTDOWN 0x27
#define VIOC_GETRXKCRYPT 0x27
#define VIOC_SETRXKCRYPT 0x28
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif /* !DJGPP */
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
smb_ioctlProc_t *smb_ioctlProcsp[SMB_IOCTL_MAXPROCS];
+extern unsigned char smb_LANadapter;
+
void smb_InitIoctl(void)
{
smb_ioctlProcsp[VIOCGETAL] = cm_IoctlGetACL;
smb_ioctlProcsp[VIOC_MAKESUBMOUNT] = cm_IoctlMakeSubmount;
smb_ioctlProcsp[VIOC_GETRXKCRYPT] = cm_IoctlGetRxkcrypt;
smb_ioctlProcsp[VIOC_SETRXKCRYPT] = cm_IoctlSetRxkcrypt;
+#ifdef DJGPP
+ smb_ioctlProcsp[VIOC_SHUTDOWN] = cm_IoctlShutdown;
+#endif
}
/* called to make a fid structure into an IOCTL fid structure */
long count;
long code;
char *op;
- long inDataBlockCount;
+ int inDataBlockCount;
code = 0;
count = smb_GetSMBParm(inp, 1);
/* called from Read Raw to handle IOCTL descriptor reads */
long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
- smb_packet_t *outp)
+ smb_packet_t *outp
+#ifdef DJGPP
+, dos_ptr rawBuf
+#endif /* DJGPP */
+)
{
smb_ioctl_t *iop;
long leftToCopy;
NCB *ncbp;
long code;
cm_user_t *userp;
+#ifdef DJGPP
+ dos_ptr dos_ncb;
+
+ if (rawBuf == 0)
+ {
+ osi_Log0(afsd_logp, "Failed to get raw buf for smb_IoctlReadRaw");
+ return -1;
+ }
+#endif /* DJGPP */
iop = fidp->ioctlp;
ncbp->ncb_length = (unsigned short) leftToCopy;
ncbp->ncb_lsn = (unsigned char) vcp->lsn;
ncbp->ncb_command = NCBSEND;
- ncbp->ncb_buffer = iop->outCopied + iop->outAllocp;
+ ncbp->ncb_lana_num = smb_LANadapter;
+#ifndef DJGPP
+ ncbp->ncb_buffer = iop->outCopied + iop->outAllocp;
code = Netbios(ncbp);
+#else /* DJGPP */
+ dosmemput(iop->outCopied + iop->outAllocp, ncbp->ncb_length, rawBuf);
+ ncbp->ncb_buffer = rawBuf;
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+ code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+
if (code != 0)
osi_Log1(afsd_logp, "ReadRaw send failure code %d", code);
extern long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
+#ifndef DJGPP
extern long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
smb_packet_t *outp);
+#else /* DJGPP */
+extern long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
+ smb_packet_t *outp, dos_ptr rawBuf);
+#endif /* !DJGPP */
#endif /* __SMB_IOCTL_H_ENV__ */
install: install_headers $(LIBFILE)
+install9x: install
+
clean::
+ $(DEL) $(LIBFILE)
\ No newline at end of file
# include the primary makefile
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\config\NTMakefile.version
+!include ..\..\config\NTMakefile.version
############################################################################
#
install : $(COPYSOURCES) $(COPYHEADERS) $(EXEFILE) lang
-lang ::
- $(CD) lang
- for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
- $(CD) ..
+install9x: install
+
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
+
############################################################################
#
# Dependencies
#
+en_US:
+ $(CD) lang
+ $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ja_JP:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ko_KR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_CN:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_TW:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+pt_BR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+es_ES:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+de_DE:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
afs_config_stub.res : afs_config_stub.rc AFS_component_version_number.h
+clean::
+ $(CD) lang
+ if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+ $(CD) ..
install : $(DLLFILE)
clean ::
- @if exist *.res del *.res
- @if exist RC*. del RC*.
- @if exist RD*. del RD*.
+ $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
############################################################################
#
# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
-!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\config\NTMakefile.version
+!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
+!include ..\..\config\NTMakefile.version
############################################################################
install: $(DLLFILE) lang
+install9x: install
+
############################################################################
# Language target
-lang::
- $(CD) lang
- for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
- $(CD) ..
-
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
############################################################################
# Local clean target; augments predefined clean target
clean::
+ $(CD) lang
+ if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+ $(CD) ..
############################################################################
# Dependencies
afs_cpa_stub.res : afs_cpa_stub.rc AFS_component_version_number.h
+en_US:
+ $(CD) lang
+ $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ja_JP:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ko_KR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_CN:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_TW:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+pt_BR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+es_ES:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+de_DE:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
# include the primary makefile
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\..\config\NTMakefile.version
+!include ..\..\..\config\NTMakefile.version
############################################################################
#
install : $(DLLFILE)
clean ::
- @if exist *.res del *.res
- @if exist RC*. del RC*.
- @if exist RD*. del RD*.
+ $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
############################################################################
#
install : $(DLLFILE)
clean ::
- @if exist *.res del *.res
- @if exist RC*. del RC*.
- @if exist RD*. del RD*.
+ $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
############################################################################
#
AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I..\afsd /D"_WINDOWS" /D"_WINDLL" /D"_AFXDLL" /D"_USRDLL"
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\config\NTMakefile.version
+!include ..\..\config\NTMakefile.version
############################################################################
# Install target; primary makefile target
install: $(DLLFILE) lang
+install9x: install
############################################################################
# Language target
-lang ::
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
+
+en_US:
+ $(CD) lang
+ $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ja_JP:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ko_KR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_CN:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_TW:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+pt_BR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+es_ES:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+de_DE:
$(CD) lang
- for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
- $(CD) ..
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
############################################################################
# Local clean target; augments predefined clean target
clean::
+ $(CD) lang
+ if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+ $(CD) ..
install : $(DLLFILE)
clean ::
- @if exist *.res del *.res
- @if exist RC*. del RC*.
- @if exist RD*. del RD*.
+ $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
############################################################################
#
--- /dev/null
+#
+# Makefile.djgpp
+# make information for this directory
+# requires gmake
+#
+
+SOURCES = osifd.c osilog.c osiqueue.c osithrd95.c
+include ../../config/Makefile.djgpp.common
+
+# apply changes from common for this directory
+#
+# no changes for this directory
+
+# what this directory builds
+#
+TARGETS = libosi.a
+all : $(TARGETS)
+install : $(DESTLIB)/libosi.a includes
+
+INCFILES = \
+ $(DESTINC)/osi.h \
+ $(DESTINC)/osifd.h \
+ $(DESTINC)/osilog.h \
+ $(DESTINC)/osiqueue.h \
+ $(DESTINC)/osisleep.h \
+ $(DESTINC)/osiutils.h \
+ $(DESTINC)/osithrd95.h
+
+# hard-wired dependency information
+#
+libosi.a : $(ALL_OBJS)
+includes: $(INCFILES)
$(INCFILEDIR)\osidb.h \
$(INCFILEDIR)\osilog.h \
$(INCFILEDIR)\osisleep.h \
- $(INCFILEDIR)\perf.h
+ $(INCFILEDIR)\perf.h \
+ $(INCFILEDIR)\osithrdnt.h
$(INCFILEDIR)\dbrpc.h: dbrpc.h
install: install_headers $(DLLFILE)
+install9x: install
+
############################################################################
# Local clean target; augments predefined clean target
clean::
- $(DEL) dbrpc_s.c dbrpc_c.c dbrpc.h
+ $(DEL) dbrpc_s.c dbrpc_c.c dbrpc.h $(DLLFILE) $(INCFILES)
#ifndef _OSI_H_ENV_
#define _OSI_H_ENV_ 1
-#include <rpc.h>
+#include <afs/param.h>
+
/* misc definitions */
+
+/* large int */
+#ifndef DJGPP
+#include <rpc.h>
+#include <largeint.h>
+#include "osithrdnt.h"
+#else /* DJGPP */
+#include "largeint95.h"
+#endif /* !DJGPP */
+
typedef LARGE_INTEGER osi_hyper_t;
+#ifndef DJGPP
typedef GUID osi_uid_t;
+#else /* DJGPP */
+typedef int osi_uid_t;
+#endif /* !DJGPP */
+
+typedef int int32;
+#ifndef DJGPP
/* basic util functions */
#include "osiutils.h"
/* lock type definitions */
#include "osiltype.h"
+#endif /* !DJGPP */
/* basic sleep operations */
#include "osisleep.h"
+#ifndef DJGPP
/* base lock definitions */
#include "osibasel.h"
/* RPC debug stuff */
#include "osidb.h"
+#else /* DJGPP */
+#include "osithrd95.h"
+#endif /* !DJGPP */
/* log stuff */
#include "osilog.h"
-/* large int */
-#include <largeint.h>
-
#endif /*_OSI_H_ENV_ */
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <rpc.h>
+#include "dbrpc.h"
+#endif /* !DJGPP */
#include <malloc.h>
#include "osi.h"
-#include "dbrpc.h"
#include <assert.h>
-static CRITICAL_SECTION osi_fdCS;
+static Crit_Sec osi_fdCS;
osi_fd_t *osi_allFDs;
osi_fdType_t *osi_allFDTypes;
long osi_nextFD = 0;
osi_fdOps_t osi_TypeFDOps = {
osi_FDTypeCreate,
+#ifndef DJGPP
osi_FDTypeGetInfo,
+#endif
osi_FDTypeClose
};
osi_fdTypeFormat_t *nffp;
/* check for dup name */
- EnterCriticalSection(&osi_fdCS);
+ thrd_EnterCrit(&osi_fdCS);
ftp = osi_FindFDType(namep);
if (!ftp) return -1;
free(ftp);
/* cleanup and go */
- LeaveCriticalSection(&osi_fdCS);
+ thrd_LeaveCrit(&osi_fdCS);
return 0;
}
osi_fdType_t *ftp;
/* check for dup name */
- EnterCriticalSection(&osi_fdCS);
+ thrd_EnterCrit(&osi_fdCS);
osi_assertx(osi_FindFDType(namep) == NULL, "registering duplicate iteration type");
ftp = (osi_fdType_t *) malloc(sizeof(*ftp));
ftp->formatListp = NULL;
osi_QAdd((osi_queue_t **) &osi_allFDTypes, &ftp->q);
- LeaveCriticalSection(&osi_fdCS);
+ thrd_LeaveCrit(&osi_fdCS);
return ftp;
}
formatp->index = index;
/* thread on the list when done */
- EnterCriticalSection(&osi_fdCS);
+ thrd_EnterCrit(&osi_fdCS);
formatp->nextp = typep->formatListp;
typep->formatListp = formatp;
- LeaveCriticalSection(&osi_fdCS);
+ thrd_LeaveCrit(&osi_fdCS);
/* all done */
return 0;
osi_allFDs = NULL;
osi_allFDTypes = NULL;
- InitializeCriticalSection(&osi_fdCS);
+ thrd_InitCrit(&osi_fdCS);
/* now, initialize the types system by adding a type
* iteration operator
/* initialize for failure */
fdp = NULL;
- EnterCriticalSection(&osi_fdCS);
+ thrd_EnterCrit(&osi_fdCS);
fdTypep = osi_FindFDType(namep);
if (fdTypep) {
code = (fdTypep->opsp->Create)(fdTypep, &fdp);
}
else fdp = NULL;
}
- LeaveCriticalSection(&osi_fdCS);
+ thrd_LeaveCrit(&osi_fdCS);
return fdp;
}
{
osi_fd_t *fdp;
- EnterCriticalSection(&osi_fdCS);
+ thrd_EnterCrit(&osi_fdCS);
for(fdp = osi_allFDs; fdp; fdp = (osi_fd_t *) osi_QNext(&fdp->q)) {
if (fdp->fd == fd) break;
}
- LeaveCriticalSection(&osi_fdCS);
+ thrd_LeaveCrit(&osi_fdCS);
return fdp;
}
{
long code;
- EnterCriticalSection(&osi_fdCS);
+ thrd_EnterCrit(&osi_fdCS);
osi_QRemove((osi_queue_t **) &osi_allFDs, &fdp->q);
- LeaveCriticalSection(&osi_fdCS);
+ thrd_LeaveCrit(&osi_fdCS);
/* this call frees the FD's storage, so make sure everything is unthreaded
* before here.
}
+#ifndef DJGPP
long osi_FDTypeGetInfo(osi_fd_t *ifdp, osi_remGetInfoParms_t *outp)
{
osi_typeFD_t *fdp;
outp->icount = 0;
outp->scount = 1;
strcpy(outp->sdata[0], typep->namep);
- EnterCriticalSection(&osi_fdCS);
+ thrd_EnterCrit(&osi_fdCS);
fdp->curp = (osi_fdType_t *) osi_QNext(&typep->q);
- LeaveCriticalSection(&osi_fdCS);
+ thrd_LeaveCrit(&osi_fdCS);
return 0;
}
else {
return OSI_DBRPC_EOF;
}
}
+#endif /* !DJGPP */
long osi_FDTypeClose(osi_fd_t *ifdp)
{
#ifndef _OSIFD_H_ENV_
#define _OSIFD_H_ENV_ 1
+#ifndef DJGPP
#include "dbrpc.h"
+#endif /* !DJGPP */
#include "osiqueue.h"
+struct osi_fd;
+struct osi_fdType;
+
/* operations on a file descriptor */
typedef struct osi_fdOps {
/* create an object, passed in the type info and returns
*/
long (*Create)(struct osi_fdType *, struct osi_fd **);
+#ifndef DJGPP
/* gets info about the object; fields are type specific, and eventually
* self-labelling
*/
long (*GetInfo)(struct osi_fd *, osi_remGetInfoParms_t *);
+#endif
/* close an object; frees the storage associated with it */
long (*Close)(struct osi_fd *);
extern long osi_FDTypeCreate(osi_fdType_t *, osi_fd_t **);
+#ifndef DJGPP
extern long osi_FDTypeGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
+#endif
extern long osi_FDTypeClose(osi_fd_t *);
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
#include <rpc.h>
+#endif /* !DJGPP */
#include <malloc.h>
#include "osi.h"
+#ifndef DJGPP
#include "dbrpc.h"
+#endif /* !DJGPP */
#include <stdio.h>
#include <assert.h>
osi_fdOps_t osi_logFDOps = {
osi_LogFDCreate,
+#ifndef DJGPP
osi_LogFDGetInfo,
+#endif
osi_LogFDClose
};
LARGE_INTEGER bigTemp;
LARGE_INTEGER bigJunk;
+#ifndef DJGPP
if (osi_Once(&osi_logOnce)) {
QueryPerformanceFrequency(&bigFreq);
if (bigFreq.LowPart == 0 && bigFreq.HighPart == 0)
/* done with init */
osi_EndOnce(&osi_logOnce);
}
+#endif /* !DJGPP */
logp = malloc(sizeof(osi_log_t));
memset(logp, 0, sizeof(osi_log_t));
logp->stringsp = malloc((size/10) * OSI_LOG_STRINGSIZE);
/* and sync */
- InitializeCriticalSection(&logp->cs);
+ thrd_InitCrit(&logp->cs);
strcpy(tbuffer, "log:");
strcat(tbuffer, namep);
typep = osi_RegisterFDType(tbuffer, &osi_logFDOps, logp);
+#ifndef DJGPP
if (typep) {
/* add formatting info */
osi_AddFDFormatInfo(typep, OSI_DBRPC_REGIONINT, 0,
osi_AddFDFormatInfo(typep, OSI_DBRPC_REGIONSTRING, 1,
"Time (mics)", 0);
}
+#endif
return logp;
}
void osi_LogReset(osi_log_t *logp)
{
if (logp) {
- EnterCriticalSection(&logp->cs);
+ thrd_EnterCrit(&logp->cs);
logp->nused = 0;
- LeaveCriticalSection(&logp->cs);
+ thrd_LeaveCrit(&logp->cs);
}
}
free(logp->namep);
free(logp->datap);
- DeleteCriticalSection(&logp->cs);
+ thrd_DeleteCrit(&logp->cs);
free(logp);
}
*/
if (!logp->enabled) return;
- EnterCriticalSection(&logp->cs);
+ thrd_EnterCrit(&logp->cs);
if (logp->nused < logp->alloc) logp->nused++;
else {
logp->first++;
if (ix >= logp->alloc) ix -= logp->alloc;
lep = logp->datap + ix; /* ptr arith */
- lep->tid = GetCurrentThreadId();
+ lep->tid = thrd_Current();
/* get the time, using the high res timer if available */
+#ifndef DJGPP
if (osi_logFreq) {
QueryPerformanceCounter(&bigTime);
lep->micros = (bigTime.LowPart / osi_logFreq) * osi_logTixToMicros;
}
else lep->micros = GetCurrentTime() * 1000;
+#else
+ lep->micros = gettime_us();
+#endif /* !DJGPP */
lep->formatp = formatp;
lep->parms[0] = p0;
lep->parms[1] = p1;
lep->parms[2] = p2;
lep->parms[3] = p3;
- LeaveCriticalSection(&logp->cs);
+ thrd_LeaveCrit(&logp->cs);
}
-void osi_LogPrint(osi_log_t *logp, HANDLE handle)
+void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle)
{
char wholemsg[1000], msg[1000];
int i, ix, ioCount;
if (!logp->enabled) return;
- EnterCriticalSection(&logp->cs);
+ thrd_EnterCrit(&logp->cs);
for (ix = logp->first, i = 0;
i < logp->nused;
lep->micros / 1000000,
lep->micros % 1000000,
lep->tid, msg);
+#ifndef DJGPP
if (!WriteFile(handle, wholemsg, strlen(wholemsg),
&ioCount, NULL))
+#else /* DJGPP */
+ if ((ioCount = fwrite(wholemsg, 1, strlen(wholemsg), handle)) == 0)
+#endif /* !DJGPP */
break;
}
- LeaveCriticalSection(&logp->cs);
+ thrd_LeaveCrit(&logp->cs);
}
char *osi_LogSaveString(osi_log_t *logp, char *s)
lfdp = malloc(sizeof(*lfdp));
logp = lfdp->logp = typep->rockp; /* the log we were created for */
- EnterCriticalSection(&logp->cs);
+ thrd_EnterCrit(&logp->cs);
lfdp->nused = logp->nused;
lfdp->first = logp->first;
lfdp->current = 0;
- LeaveCriticalSection(&logp->cs);
+ thrd_LeaveCrit(&logp->cs);
*outpp = &lfdp->fd;
return 0;
}
+#ifndef DJGPP
long osi_LogFDGetInfo(osi_fd_t *ifd, osi_remGetInfoParms_t *outp)
{
osi_logFD_t *lfdp;
if (lfdp->current >= lfdp->nused) return OSI_DBRPC_EOF;
/* grab lock */
- EnterCriticalSection(&logp->cs);
+ thrd_EnterCrit(&logp->cs);
/* compute which one we want */
ix = lfdp->first + lfdp->current;
outp->scount = 2;
outp->icount = 1;
- LeaveCriticalSection(&logp->cs);
+ thrd_LeaveCrit(&logp->cs);
return 0;
}
+#endif /* !DJGPP */
long osi_LogFDClose(osi_fd_t *ifdp)
{
#ifndef _OSI_LOG_H__
#define _OSI_LOG_H__ 1
+#include "osi.h"
+#ifndef DJGPP
#include "osisleep.h"
#include "osibasel.h"
#include "osistatl.h"
+#endif /* !DJGPP */
#include "osifd.h"
#include "osiqueue.h"
long alloc; /* allocated size */
long nused; /* number currently in use */
long first; /* index of first entry */
- CRITICAL_SECTION cs; /* use this, rather than a higher-level
+ Crit_Sec cs; /* use this, rather than a higher-level
* lock, so we can log stuff from
* osi lock pkg */
osi_logEntry_t *datap; /* data for the log */
extern long osi_LogFDCreate(osi_fdType_t *, osi_fd_t **);
+#ifndef DJGPP
extern long osi_LogFDGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
+#endif
extern long osi_LogFDClose(osi_fd_t *);
extern void osi_LogPanic(char *filep, long line);
-extern void osi_LogPrint(osi_log_t *logp, HANDLE handle);
+extern void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle);
extern char *osi_LogSaveString(osi_log_t *logp, char *s);
#include <afs/param.h>
#include <afs/stds.h>
+#ifndef DJGPP
#include <windows.h>
+#endif /* !DJGPP */
#include "osi.h"
#include <stdlib.h>
/* critical section protecting allocation of osi_queueData_t elements */
-CRITICAL_SECTION osi_qdcrit;
+Crit_Sec osi_qdcrit;
/* free list of queue elements */
osi_queueData_t *osi_QDFreeListp = NULL;
if (initd) return;
initd = 1;
- InitializeCriticalSection(&osi_qdcrit);
+ thrd_InitCrit(&osi_qdcrit);
}
osi_queueData_t *osi_QDAlloc(void)
osi_queueData_t *tp;
int i;
- EnterCriticalSection(&osi_qdcrit);
+ thrd_EnterCrit(&osi_qdcrit);
if (tp = osi_QDFreeListp) {
osi_QDFreeListp = (osi_queueData_t *) tp->q.nextp;
}
*/
tp->datap = NULL;
}
- LeaveCriticalSection(&osi_qdcrit);
+ thrd_LeaveCrit(&osi_qdcrit);
osi_assertx(tp->datap == NULL, "queue freelist screwup");
void osi_QDFree(osi_queueData_t *qp)
{
- EnterCriticalSection(&osi_qdcrit);
+ thrd_EnterCrit(&osi_qdcrit);
qp->q.nextp = (osi_queue_t *) osi_QDFreeListp;
qp->datap = NULL;
osi_QDFreeListp = qp;
- LeaveCriticalSection(&osi_qdcrit);
+ thrd_LeaveCrit(&osi_qdcrit);
}
#ifndef _OSISLEEP_H_ENV_
#define _OSISLEEP_H_ENV_ 1
+/*#include "osi.h"*/
#include "osifd.h"
#include "osiqueue.h"
+#ifdef DJGPP
+#include "osithrd95.h"
+#endif /* DJGPP */
/* states bits */
#define OSI_SLEEPINFO_SIGNALLED 1 /* this sleep structure has been signalled */
osi_queue_t q;
long value; /* sleep value when in a sleep queue, patch addr for turnstiles */
unsigned long tid; /* thread ID of sleeper */
- HANDLE sema; /* semaphore for this entry */
+ EVENT_HANDLE sema; /* semaphore for this entry */
unsigned short states; /* states bits */
unsigned short idx; /* sleep hash table we're in, if in hash */
unsigned short waitFor; /* what are we waiting for; used for bulk wakeups */
/* struct for single-shot initialization support */
typedef struct osi_once {
+#ifndef DJGPP
long atomic; /* used for atomicity */
+#else
+ osi_mutex_t atomic; /* used for atomicity */
+#endif /* !DJGPP */
int done; /* tells if initialization is done */
} osi_once_t;
* holding this lock, so that locks don't get released while we're copying
* out this info.
*/
-extern CRITICAL_SECTION osi_sleepCookieCS;
+extern Crit_Sec osi_sleepCookieCS;
/* spin lock version of atomic sleep, used internally only */
-extern void osi_SleepSpin(long value, CRITICAL_SECTION *counterp);
+extern void osi_SleepSpin(long value, Crit_Sec *counterp);
/* spin lock version of wakeup, used internally only */
extern void osi_WakeupSpin(long value);
*/
extern void osi_EndOnce(osi_once_t *);
+
+#ifndef DJGPP
/* exported function to wakeup those sleeping on a value */
extern void osi_Wakeup (long);
extern void osi_Init (void);
+#endif /* !DJGPP */
/* create a ptr to a cookie */
osi_sleepFD_t *osi_CreateSleepCookie(void);
/* functions for the sleep FD implementation */
extern long osi_SleepFDCreate(osi_fdType_t *, osi_fd_t **);
+#ifndef DJGPP
extern long osi_SleepFDGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
+#endif
extern long osi_SleepFDClose(osi_fd_t *);
/* functions for getting hash sizes */
unsigned long osi_Time(void);
extern void osi_TWait(osi_turnstile_t *turnp, int waitFor, void *patchp,
- CRITICAL_SECTION *releasep);
+ Crit_Sec *releasep);
extern void osi_TSignal(osi_turnstile_t *turnp);
extern void osi_TBroadcast(osi_turnstile_t *turnp);
-extern void osi_TSignalForMLs(osi_turnstile_t *turnp, int stillHaveReaders, CRITICAL_SECTION *csp);
+extern void osi_TSignalForMLs(osi_turnstile_t *turnp, int stillHaveReaders, Crit_Sec *csp);
#define osi_TInit(t) ((t)->firstp = (t)->lastp = 0)
--- /dev/null
+/*
+ * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved
+ *
+ * (C) COPYRIGHT IBM CORPORATION 1987, 1988
+ * LICENSED MATERIALS - PROPERTY OF IBM
+ *
+ */
+
+/* Copyright (C) 1994 Cazamar Systems, Inc. */
+
+#include "osi.h"
+#include "lwp.h"
+/*#include "lock95.h"*/
+#include <assert.h>
+
+#include <stdio.h>
+
+/*
+thread95.c
+
+This code implements a partial OSI-over-LWP(and IOMGR) layer for threading
+and synchronization, for the AFS NT code port to Windows 9x.
+*/
+
+// It so happens that all code seen so far throws away *thread_id;
+// unfortunately, callers do not send thread_id==NULL instead of getting
+// a value and tossing it. :(
+thread_t thrd_Create(int attributes, int stacksize, ThreadFunc func,
+ void *parm, int flags, int *thread_id, char *name)
+{
+ PROCESS lwp_pid;
+
+ // Reserve priority 0 for IOMGR; we use pri 1 by default
+ if (name)
+ LWP_CreateProcess(func, stacksize, 1, parm, name, &lwp_pid);
+ else
+ LWP_CreateProcess(func, stacksize, 1, parm, "thread", &lwp_pid);
+
+ // In principle, the "right" way to do thread_id is to create a mapping
+ // between thread_id integers and LWP PROCESS names, but we're not using
+ // the IDs for anything anyway, so...
+ // actually, it turns out PROCESS is a pointer, so we fudge with that for now
+ // just to return a nonzero value
+ *thread_id = (int) lwp_pid;
+
+ return lwp_pid;
+}
+
+thread_t thrd_Current()
+{
+ PROCESS pid;
+ LWP_CurrentProcess(&pid);
+ return pid;
+}
+
+int thrd_Close(thread_t thrd)
+{
+ int rc = LWP_DestroyProcess(thrd);
+ if (rc == LWP_SUCCESS)
+ return 0;
+ else
+ return -1;
+}
+
+/* The following thread-local-storage and critical-section functions are
+ not used. */
+/*
+DWORD thrd_Alloc(void)
+{
+ char **NewRock = NULL;
+ static int NextTag = 0; // Because LWP is not preemptive, we need no mutex
+
+ NewRock = (char **) malloc (sizeof(LPVOID *));
+ if (NewRock == NULL)
+ return 0xFFFFFFFF;
+ *NewRock = (LPVOID *) malloc(sizeof(LPVOID));
+ if (*NewRock == NULL) {
+ free(NewRock);
+ return 0xFFFFFFFF;
+ }
+
+ if (LWP_NewRock(++NextTag,NewRock))
+ return 0xFFFFFFFF;
+ else
+ return NextTag;
+}
+
+LPVOID thrd_GetValue(DWORD Index)
+{
+ char *ptr;
+ if (LWP_GetRock((int) Index, &ptr)) {
+ // SetLastError
+ return 0;
+ } else {
+ return * ((LPVOID *) ptr);
+ }
+}
+
+BOOL thrd_SetValue(DWORD Index, LPVOID Value) {
+ char *ptr;
+ if (LWP_GetRock((int) Index, &ptr)) {
+ // SetLastError
+ return 0;
+ } else {
+ * ((LPVOID *) ptr) = Value;
+ return TRUE;
+ }
+}
+
+#define LPCRITICAL_SECTION (struct Lock*)
+
+#define thrd_InitCrit (Lock_Init)
+#define thrd_EnterCrit (ObtainWriteLock)
+#define thrd_LeaveCrit (ReleaseWriteLock)
+
+// LWP has no formal destructor for locks.
+#define thrd_DeleteCrit(x) ;
+
+*/
+
+
+/* Since LWP is nonpreemptive, arithmetic needs no special handling. */
+
+LONG thrd_Increment(LPLONG number)
+{
+ ++*number;
+ return *number;
+}
+
+LONG thrd_Decrement(LPLONG number)
+{
+ --*number;
+ return *number;
+}
+
+LONG thrd_Exchange(LPLONG number, LONG value)
+{
+ LONG oldval = *number;
+ *number = value;
+ return oldval;
+}
+
+// CreateEvent is always called with (NULL,(T/F),(T/F),NULL)
+// This code will assume it and fail otherwise.
+// SetLastError() is not implemented, i.e., if thrd_CreateEvent fails,
+// there is no corresponding GetLastError() to pull out error codes
+// at this time.
+EVENT *thrd_CreateEvent(void *f, BOOL manual, BOOL startsignaled, void *g)
+{
+ // LWP code checks eventnames against NULL as an error condition,
+ // so we start counting from 1 instead of zero.
+ // It turns out that LWP uses event names as unique integer values,
+ // even though these values are cast as char pointers. We will use
+ // integers, since they are never dereferenced by LWP.
+ static unsigned long NextEventName = 1L;
+ EVENT *event;
+
+ // Startup stuff
+ if ((f != NULL) || (g != NULL)) {
+ // Panic! This scenario is not implemented.
+ assert(0);
+ return NULL;
+ }
+
+ // Create an event
+ if ((event=(EVENT*)malloc(sizeof(EVENT))) == NULL)
+ {
+ // SetLastError out of memory
+ return NULL;
+ }
+ if (manual)
+ event->state = startsignaled ? manualsignal : manualunsig;
+ else
+ event->state = startsignaled ? autosignal : autounsig;
+ event->name = (char *) NextEventName;
+
+ // Increment NextEventName
+ ++NextEventName;
+
+ return event;
+}
+
+BOOL thrd_SetEvent(EVENT *event)
+{
+ if (event==NULL)
+ return FALSE;
+ if (AUTOMATIC(event))
+ event->state = autosignal;
+ else
+ event->state = manualsignal;
+ LWP_SignalProcess(event->name);
+ return TRUE;
+}
+
+BOOL thrd_ResetEvent(EVENT *event)
+{
+ if (event==NULL)
+ return FALSE;
+ if (AUTOMATIC(event))
+ event->state = autounsig;
+ else
+ event->state = manualunsig;
+ return TRUE;
+}
+
+// It appears there is a slight difference in the two wait schemes.
+// Win32's WaitForSingleObject returns only when the wait is finished;
+// LWP's WaitProcess may return randomly, and so requires while() wrapping
+// (a little busywaiting).
+DWORD thrd_WaitForSingleObject_Event(EVENT *event, DWORD timeoutms)
+{
+ if (timeoutms != INFINITE) {
+ // Panic!
+ assert(0);
+ return WAIT_FAILED;
+ }
+ if (event == NULL) {
+ return WAIT_FAILED;
+ }
+ while (!SIGNALED(event))
+ LWP_WaitProcess(event->name);
+ if (AUTOMATIC(event))
+ event->state = autounsig;
+ return WAIT_OBJECT_0;
+}
+
+DWORD thrd_WaitForMultipleObjects_Event(DWORD count, EVENT* events[],
+ BOOL waitforall, DWORD timeoutms)
+{
+ if ((timeoutms != INFINITE) || waitforall) {
+ // Panic! This functionality not implemented.
+ assert(0);
+ return WAIT_FAILED;
+ }
+ if (events == NULL) {
+ return WAIT_FAILED;
+ }
+
+ // Do the actual wait
+ {
+ // Construct the list of LWP events to wait on
+ char *names[count+1];
+ int i;
+ for (i=0;i<count;++i) {
+ if (SIGNALED(events[i])) {
+ // We're done; one of the events is signaled.
+ if (AUTOMATIC(events[i]))
+ events[i]->state = autounsig;
+ return (WAIT_OBJECT_0 + i);
+ }
+ names[i] = events[i]->name;
+ }
+ names[count] = NULL;
+
+ // Do the wait for something to signal
+ while (1) {
+ LWP_MwaitProcess(1,names);
+ // Find who got signalled: MwaitProcess doesn't tell us.
+ for (i=0; i<count; ++i) {
+ if (SIGNALED(events[i])) {
+ if (AUTOMATIC(events[i]))
+ events[i]->state = autounsig;
+ return WAIT_OBJECT_0 + i;
+ }
+ }
+ }
+ // not reached
+ assert(0);
+ }
+ // not reached
+ assert(0);
+}
+
+int osi_Once(osi_once_t *argp)
+{
+ long i;
+
+ lock_ObtainMutex(&argp->atomic);
+
+ if (argp->done == 0) {
+ argp->done = 1;
+ return 1;
+ }
+
+ /* otherwise we've already been initialized, so clear lock and return */
+ lock_ReleaseMutex(&argp->atomic);
+ return 0;
+}
+
+void osi_EndOnce(osi_once_t *argp)
+{
+ lock_ReleaseMutex(&argp->atomic);
+}
+
+int osi_TestOnce(osi_once_t *argp)
+{
+ long localDone;
+ long i;
+
+ lock_ObtainMutex(&argp->atomic);
+
+ localDone = argp->done;
+
+ /* drop interlock */
+ lock_ReleaseMutex(&argp->atomic);
+
+ return (localDone? 0 : 1);
+}
+
+void osi_panic(char *s, char *f, long l)
+{
+ fprintf(stderr, "Fatal error: %s at %s:%d\n", s, f, l);
+ exit(1);
+}
+
+/* return true iff x is prime */
+int osi_IsPrime(unsigned long x)
+{
+ unsigned long c;
+
+ /* even numbers aren't prime */
+ if ((x & 1) == 0 && x != 2) return 0;
+
+ for(c = 3; c<x; c += 2) {
+ /* see if x is divisible by c */
+ if ((x % c) == 0) return 0; /* yup, it ain't prime */
+
+ /* see if we've gone far enough; only have to compute until
+ * square root of x.
+ */
+ if (c*c > x) return 1;
+ }
+
+ /* probably never get here */
+ return 1;
+}
+
+/* return first prime number less than or equal to x */
+unsigned long osi_PrimeLessThan(unsigned long x) {
+ unsigned long c;
+
+ for(c = x; c > 1; c--) {
+ if (osi_IsPrime(c)) return c;
+ }
+
+ /* ever reached? */
+ return 1;
+}
--- /dev/null
+#ifndef THRD95_H
+#define THRD95_H
+
+#include <lwp.h>
+#include <lock.h>
+#include <assert.h>
+#include <stdio.h>
+
+/* Since we don't have windows.h to define booleans, we do it ourselves */
+#ifndef TRUE
+ #define TRUE (1)
+#endif
+#ifndef FALSE
+ #define FALSE (0)
+#endif
+
+#define osi_rwlock_t struct Lock
+#define osi_mutex_t struct Lock
+
+#define osi_Init() { PROCESS pid; LWP_InitializeProcessSupport(1,&pid); IOMGR_Initialize(); }
+
+/*
+#define lock_InitializeMutex(a, b) Lock_Init(a)
+#define lock_InitializeRWLock(a, b) Lock_Init(a)
+*/
+
+#define lock_InitializeRWLock(a, b) Lock_Init(a)
+#define lock_InitializeMutex(a, b) lock_InitializeRWLock(a,b)
+
+#define lock_ObtainWrite(a) ObtainWriteLock(a)
+#define lock_ObtainRead(a) ObtainReadLock(a)
+#define lock_ObtainMutex(a) lock_ObtainWrite(a)
+#define lock_ReleaseRead(a) ReleaseReadLock(a)
+#define lock_ReleaseWrite(a) ReleaseWriteLock(a)
+#define lock_ReleaseMutex(a) lock_ReleaseWrite(a)
+
+#define lock_FinalizeRWLock(a) /* */
+#define lock_FinalizeMutex(a) lock_FinalizeRWLock(a)
+
+/*
+#define lock_TryWrite(a) if (!WriteLocked(a)) ObtainWriteLock(a)
+#define lock_TryRead(a) if (!WriteLocked(a)) ObtainReadLock(a)
+#define lock_TryMutex(a) if (!WriteLocked(a)) ObtainWriteLock(a)
+*/
+#define lock_TryWrite(a) ( ((CheckLock(a)) == 0) ? (({ObtainWriteLock(a);}), 1) : 0 )
+#define lock_TryRead(a) ( ((CheckLock(a)) > -1) ? (({ObtainReadLock(a);}), 1) : 0 )
+#define lock_TryMutex(a) lock_TryWrite(a)
+#define lock_GetMutexState(a) CheckLock(a)
+#define lock_AssertMutex(a) assert(lock_GetMutexState(a) == -1)
+#define lock_AssertWrite(a) assert(lock_GetMutexState(a) == -1)
+
+#define Crit_Sec osi_mutex_t
+#define thrd_InitCrit(a) lock_InitializeMutex(a, "cs")
+#define thrd_EnterCrit lock_ObtainMutex
+#define thrd_LeaveCrit lock_ReleaseMutex
+#define thrd_DeleteCrit(a)
+
+// Does LWP take a char* and read it as ASCIIZ, or as a pointer?
+// ASCIIZ, perhaps?
+/*
+#define osi_Sleep(a) { char buf[sizeof(long)+1]; memcpy(buf,&a,sizeof(long)); buf[sizeof(long)]='\0'; LWP_WaitProcess(buf); }
+*/
+// Actually, pointer (from reading LWP source)
+#define osi_Sleep(a) LWP_WaitProcess(a);
+
+#define __do_LWP_sleep(v,l,f) { f(l); osi_Sleep(v); }
+#define osi_SleepM(a,b) __do_LWP_sleep(a,b,lock_ReleaseMutex)
+#define osi_SleepR(a,b) __do_LWP_sleep(a,b,lock_ReleaseRead)
+#define osi_SleepW(a,b) __do_LWP_sleep(a,b,lock_ReleaseWrite)
+
+/*
+#define osi_Wakeup(a) { char buf[sizeof(long)+1]; memcpy(buf,&a,sizeof(long)); buf[sizeof(long)]='\0'; LWP_SignalProcess(buf); }
+*/
+#define osi_Wakeup(a) LWP_SignalProcess(a)
+
+/*
+#define thrd_Sleep(a) IOMGR_Select(0, 0, 0, 0, a)
+*/
+#define thrd_Sleep(a) IOMGR_Sleep((a)/1000)
+
+#define thrd_Yield LWP_DispatchProcess
+
+/* For thread95.c */
+#define __EVENT_NAME_LENGTH 10
+typedef struct __event {
+ enum { manualunsig = 0, autounsig = 2,
+ autosignal = 3, manualsignal = 1 } state;
+ char *name; // "Name" of corresponding LWP events
+ // char name[__EVENT_NAME_LENGTH+1]; // Name of corresponding LWP events
+} EVENT;
+#define SIGNALED(event) (event->state & 0x01)
+#define AUTOMATIC(event) (event->state & 0x02)
+
+typedef PROCESS thread_t;
+typedef int (*ThreadFunc)(void *);
+typedef int SecurityAttrib;
+
+thread_t thrd_Create(int attributes, int stacksize, ThreadFunc func,
+ void *parm, int flags, int *thread_id, char *name);
+#define thrd_Exit(rc) return(rc)
+thread_t thrd_Current(void);
+int thrd_Close(thread_t thrd);
+#define thrd_CloseHandle(h)
+
+typedef long int LONG;
+typedef LONG *LPLONG;
+LONG thrd_Increment(LPLONG number);
+LONG thrd_Decrement(LPLONG number);
+LONG thrd_Exchange(LPLONG number, LONG value);
+
+typedef enum { False=0, True=1 } BOOL;
+typedef EVENT *EVENT_HANDLE; /* Absorbs Win32 type HANDLE when used for synch */
+EVENT *thrd_CreateEvent(void *f, BOOL manual, BOOL startsignaled, void *g);
+BOOL thrd_SetEvent(EVENT *event);
+BOOL thrd_ResetEvent(EVENT *event);
+
+typedef unsigned long DWORD;
+#define INFINITE (0xFFFFFFFF) // infinite timeout for waits
+#define WAIT_FAILED (0xFFFFFFFF)
+#define WAIT_OBJECT_0 (0L)
+#define CONST const
+DWORD thrd_WaitForSingleObject_Event(EVENT *event, DWORD timeoutms);
+DWORD thrd_WaitForMultipleObjects_Event(DWORD count, EVENT* events[],
+ BOOL waitforall, DWORD timeoutms);
+
+#define osi_Time gettime_ms
+
+typedef FILE *FILE_HANDLE;
+
+#endif /* #ifndef THRD95_H */
--- /dev/null
+/* Defines for abstraction layer for NT */
+
+#ifndef THREAD_NT_H
+#define THREAD_NT_H
+
+#define thread_t HANDLE
+#define ThreadFunc LPTHREAD_START_ROUTINE
+#define SecurityAttrib PSECURITY_ATTRIBUTES
+
+#define thrd_Create(security, stacksize, function, arg1, arg2, pid, name) \
+ CreateThread(security, stacksize, function, arg1, arg2, pid)
+
+#define thrd_CloseHandle(phandle) CloseHandle(phandle)
+
+#define thrd_CreateEvent CreateEvent
+#define thrd_SetEvent SetEvent
+#define thrd_ResetEvent ResetEvent
+#define thrd_Increment InterlockedIncrement
+#define thrd_Decrement InterlockedDecrement
+#define thrd_WaitForSingleObject_Event WaitForSingleObject
+#define thrd_WaitForMultipleObjects_Event WaitForMultipleObjects
+
+#define thrd_Sleep Sleep
+
+#define Crit_Sec CRITICAL_SECTION
+#define thrd_InitCrit InitializeCriticalSection
+#define thrd_EnterCrit EnterCriticalSection
+#define thrd_LeaveCrit LeaveCriticalSection
+#define thrd_DeleteCrit DeleteCriticalSection
+
+#define thrd_Current GetCurrentThreadId
+
+#define EVENT_HANDLE HANDLE
+#define FILE_HANDLE HANDLE
+
+#endif /* THREAD_NT_H */
$(LIBARCH)
############################################################################
+
install: $(LIBFILE) lang
-lang ::
+install9x: install
+
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
+
+en_US:
+ $(CD) lang
+ $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ja_JP:
$(CD) lang
- for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
- $(CD) ..
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+ko_KR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_CN:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+zh_TW:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+pt_BR:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+es_ES:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
+
+de_DE:
+ $(CD) lang
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(CD) ..
clean::
+ $(DEL) $(LIBFILE)
+ $(CD) lang
+ if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+ $(CD) ..
+
############################################################################
install: $(INCFILES) $(DLLFILE)
+install9x: install
+
clean::
+ $(DEL) $(INCFILES) $(DLLFILE)
\ No newline at end of file
--- /dev/null
+>andrew.cmu.edu #Carnegie Mellon University - Computing Services
+128.2.10.11 #vice11.fs.andrew.cmu.edu
+128.2.10.12 #vice12.fs.andrew.cmu.edu
+128.2.10.2 #vice2.fs.andrew.cmu.edu
+128.2.10.28 #vice28.fs.andrew.cmu.edu
+128.2.10.7 #vice7.fs.andrew.cmu.edu
+>cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci.
+128.2.206.130 #cucumber.srv.cs.cmu.edu
+128.2.222.199 #papaya.srv.cs.cmu.edu
+128.2.242.86 #lemon.srv.cs.cmu.edu
+>ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept.
+128.2.129.7 #porok.ece.cmu.edu
+128.2.129.8 #vicio.ece.cmu.edu
+128.2.129.9 #e-xing.ece.cmu.edu
+>athena.mit.edu #MIT/Athena cell
+18.70.0.6 #prill.mit.edu.
+18.145.0.25 #agamemnon.mit.edu.
+18.159.0.34 #chimera.mit.edu.
+>dev.mit.edu #MIT/IS Development cell
+18.86.0.28 #wham.mit.edu.
+18.86.0.50 #hum.mit.edu.
+18.86.0.51 #rattle.mit.edu.
+>net.mit.edu #MIT/Network Group cell
+18.72.1.38 #gracie.mit.edu.
+18.72.0.26 #cetus.mit.edu.
+>sipb.mit.edu #MIT/SIPB cell
+18.181.0.19 #reynelda.mit.edu.
+18.181.0.23 #ronald-ann.mit.edu.
+18.181.0.22 #rosebud.mit.edu.
+>ir.stanford.edu #Stanford University
+171.64.7.222 #afsdb1.stanford.edu
+171.64.7.234 #afsdb2.stanford.edu
+171.64.7.246 #afsdb3.stanford.edu
+>umr.edu #University of Missouri - Rolla
+131.151.1.59 #afs1.umr.edu
+131.151.1.70 #afs6.umr.edu
+131.151.1.146 #afs5.umr.edu
+>dementia.org #Dementia Unlimited
+128.2.35.149 #alycia.dementia.org
+128.2.120.216 #meredith.dementia.org
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+
+!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
+!INCLUDE ..\..\..\config\NTMakefile.version
+OUTDIR = $(DESTDIR)\WinInstall
+
+############################################################################
+
+COMPONENTS = \
+ INSTALL.BAT \
+ UNINSTALL.BAT \
+ afsd.pif \
+ cellservdb \
+ readme.doc \
+ license.txt \
+ AFSD.EXE \
+ templet.reg \
+ runonce.pif \
+ $(DESTDIR)\bin\util_cr.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\unlog.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\afs_shl_ext_1033.dll \
+ $(DESTDIR)\lib\afsauthent.dll \
+ $(DESTDIR)\root.client\usr\vice\etc\afsshare.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\fs.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\klog.exe \
+ $(DESTDIR)\bin\kpasswd.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\libosi.dll \
+ $(DESTDIR)\root.client\usr\vice\etc\libafsconf.dll \
+ $(DESTDIR)\bin\pts.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\tokens.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\afs_shl_ext.dll \
+ $(DESTDIR)\lib\win95\pthread.dll \
+ $(DESTDIR)\lib\afsrpc.dll
+
+
+$(COMPONENTS)::
+ $(COPY) $@ $(DESTDIR)\WinInstall\.
+
+!IF (EXIST(ISBUILD.H))
+!INCLUDE ISBUILD.MAK
+!ENDIF
+
+build:
+ copy install.bat $(OUTDIR)\.
+
+install: prep $(COMPONENTS) build
+
+install9x: install
+
+clean ::
+ $(DEL) $(OUTDIR)\DiskIm~1\Disk1\*
+ $(DEL) $(OUTDIR)\DiskIm~1\WebInstall\*
+
+.SILENT:
+prep :
+ if not exist $(DESTDIR)\WinInstall\sock.vxd $(DESTDIR)\bin\util_cr.exe ~ "SOCK.VXD is missing from $(DESTDIR)\WinInstall\."
+ if not exist $(DESTDIR)\WinInstall\mmap.vxd $(DESTDIR)\bin\util_cr.exe ~ "MMAP.VXD is missing from $(DESTDIR)\WinInstall\."
+ if not exist $(DESTDIR)\WinInstall\afsd.exe $(DESTDIR)\bin\util_cr.exe ~ "AFSD.EXE is missing from $(DESTDIR)\WinInstall\."
+
--- /dev/null
+{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman Times New Roman;}{\f3\froman Times New Roman;}}
+{\colortbl\red0\green0\blue0;\red0\green0\blue255;}
+\deflang1033\pard\qc\plain\f2\fs28\b AFS Client for Windows 95/98 (\plain\f2\fs20\b Version 2.0.0.0 - 04/20/01 12:18 PM\plain\f2\fs28\b )
+\par \pard\plain\f2\fs28
+\par \plain\f2\fs20 Welcome to the Open AFS Client for Windows 95/98.
+\par
+\par This client will allow you to access files on sites stored all over the Internet as though the files were residing on your local machine. You can store your own files on the Internet to share with others, and can limit access to your files to specific users or groups of users. You can browse through the different AFS sites (known as \plain\f2\fs20\i cells\plain\f2\fs20 ) from a single file tree and use standard Windows programs such as Explorer to copy and manipulate files. You can open files stored on the Internet directly from Windows applications.
+\par
+\par One drive letter will be created on your machine by default - Z:. The Z: drive will be the root of the AFS tree, allowing you to browse all sites that have AFS servers available.
+\par
+\par This is a native Windows 9x client; a gateway machine is not required.
+\par
+\par \plain\f2\fs24\b System Requirements
+\par
+\par \plain\f2\fs20 IBM compatible PC running Windows 95 (see below) or 98
+\par 16 MB RAM
+\par 20 MB free disk space
+\par Client for Microsoft Networks must be installed
+\par TCP/IP protocol stack must be installed
+\par
+\par \plain\f2\fs24\b Getting Started
+\par \plain\f2\fs20
+\par To use the client, you will need to perform the following tasks after installation and reboot:
+\par
+\par 1) Boot up your machine and log in to Windows. (Note: if you bypass the login by hitting "Cancel" at the login screen, Windows networking will not work and you will not be able to mount your drives.)
+\par 2) Connect to the Internet or your company's intranet. (Note: If you are using the client in a firewalled intranet environment with private AFS cells, you will probably need a CellServDB file specific to your
+\par company's environment. Ask your system administrator.)
+\par 3) Check your system time, timezone, and date settings and make sure they are synchronized with the AFS server.
+\par 4) Start the AFS Client by double-clicking on the icon on the desktop or Start Menu.
+\par 5) A box will appear asking for your userid and password. Type them in and press "Connect". This will
+\par authenticate you to the AFS cell you specified at installation. (Note: You cannot use the GUI interface to authenticate to other cells at present. This will be added later. You can still authenticate to other cells using the "klog" command; see "Command Line Tools" below.) Use the "Save Password" checkbox to enable the AFS Client to save your password in the registry for use next time you run the AFS Client. (The password will be saved encrypted in the registry if you are running Windows 98 or have installed Internet Explorer version 4.0 or later. Otherwise, it will be saved in clear text. We recommend you do not use the save password feature if encryption is not available on your system.)
+\par 6) Now a Windows Explorer will start to allow you to browse your new Z: drive. Z: will be the root of the AFS tree.
+\par 7) By checking "Advanced Options", you can add and change your drive letter assignments. There is one share assigned by default, "all". (Note: the "all" share cannot be removed.) New shares must be assigned a unique share name and an AFS path. You can mount and unmount your AFS drives by checking or unchecking the box next to each drive letter. You can also set whether a drive will be automatically mounted at startup by highlighting the drive and clicking "Change".
+\par 8) You can kill or minimize the AFS client dialog window. Double click the icon in the system tray to restore it.
+\par 9) When you are ready to shut down the AFS client, bring up the AFS client dialog and click the "Disconnect" button. This will terminate the AFS daemon. Then click "Exit" to quit.
+\par
+\par Complete documentation for the AFS client is available at:
+\par http://www.openafs.org/dl/openafs/1.0.2/afs-3.6-doc.tar.gz
+\par
+\par \plain\f2\fs24\b Explorer Shell Extension
+\par
+\par \plain\f2\fs20 You can right click on items within an AFS tree to bring up an "AFS" menu item. Under this menu are various operations you can execute on a file or directory. The most useful item is "Access Control Lists" which allows you to view and edit the permissions of a particular directory.
+\par
+\par
+\par \plain\f2\fs24\b Command Line Tools
+\par
+\par \plain\f2\fs20 The following command line tools are available in the install directory. See the full documentation at the above URL for complete information on these commands:
+\par
+\par klog.exe: \tab Authenticate a user to a cell, e.g. "klog joeuser@mycell.com" \tab
+\par unlog.exe: \tab Unauthenticate to a cell\tab
+\par tokens.exe\tab List which tokens you have (cells you have authenticated to) and their expiration times\tab
+\par kpasswd.exe\tab Change your password for the specified cell\tab
+\par symlink.exe: \tab Create a symbolic link , e.g. "symlink make dest src" makes a link called "dest" pointing to file "src"\tab
+\par fs.exe: \tab This command is used for a number of file server functions. Type "fs help" for a list, and then "fs help function" to get detailed help for that function. See the documentation for more info.\tab
+\par fs help\tab list functions\tab
+\par fs listacl <directory>\tab show directory access control list\tab
+\par fs setacl <diretory> <acl>\tab set directory access control list\tab
+\par fs listquota <directory>\tab show directory disk quota\tab
+\par fs flushvolume <directory>\tab flush cached data from volume\tab
+\par pts.exe\tab This command is used for user administration functions. See the documentation for more info. (Note: this command currently does not work in Windows 95.)\tab
+\par
+\par \plain\f2\fs24\b Known Issues
+\par
+\par \pard\li720\fi-360\plain\f2\fs20 1) The Microsoft Visual Studio linker "link.exe" fails when writing to a file stored in AFS. It freezes the system for a minute or so and then times out. This problem may exist in other programs as well.
+\par 2) Occasionally the U: and Z: drive letters are not mapped automatically when the client is started. If this happens, you can map them manually by entering the commands:
+\par \pard\li1440\fi-360\tx1440\plain\f2\fs20 0net use u: \\\\mymachine-afs\\home
+\par 1net use z: \\\\mymachine-afs\\all
+\par 2where "mymachine" is the Windows networking name of your machine.
+\par \pard\li720\fi-360\plain\f2\fs20 3) The Windows file system does not understand symbolic links, so links to directories just look like normal directories. This can lead to problems when trying to recursively copy a directory, since following cyclical links can lead to infinite regress.
+\par 4) The Office 2000 install program seems to take a very long time to install Office 2000 to AFS.
+\par 5) You must log in to Windows for Windows networking to work correctly. If you bypass the login, AFS will time out trying to start the AFS client console, with the error "Connect can't continue: Network error adding Z:all."
+\par 6) Under certain configurations the AFS Client Console will report a cache error. This will prevent the AFS Client from initializing.
+\par 7) Infrequently Windows will incorrectly notify the AFS Control Panel that there are open files. If this prevents AFS from disconnecting, it will require you to reboot.
+\par \pard\plain\f2\fs20
+\par
+\par \plain\f2\fs24\b Legalities
+\par
+\par \pard\li720\ri810\plain\f2\fs24\i Copyright 2000, International Business Machines Corporation and others. All Rights Reserved. This software has been released under the terms of the IBM Public License. For details, see the LICENSE file in the top-level source directory or online at \plain\f2\fs24\cf1\i\ul http://www.openafs.org/dl/license10.html\plain\f2\fs24\b
+\par \pard\plain\f2\fs24\b
+\par \plain\f2\fs20 This program was compiled using the DJGPP compiler and includes object code copyrighted by DJ Delorie. The compiler and libraries are available at http://www.delorie.com.
+\par
+\par This program includes software developed by the University of California, Berkeley, and its contributors.
+\par
+\par This program has been distributed with, and uses the services of, the sock.vxd and mmap.vxd drivers written for the Coda project at http://www.coda.cs.cmu.edu and licensed under the GNU General Public License. Source code for these drivers is available at the above web site.
+\par
+\par
+\par }
+\0
\ No newline at end of file
--- /dev/null
+@echo off
+
+if [%2]==[] goto noparm
+if [%2]==[] goto noparm
+if [%3]==[] goto noparm
+if not [%5]==[] goto BEGIN
+:noparm
+ECHO 1 parameter = full source path to .\winstall area e.g. d:\dest\wininstall
+echo 2 & 3 parameters = target drive target folder c: afscli
+echo 4 parameters CellName e.g k56.almaden.ibm.com
+echo 5 parameter cache size e.g. 40000
+goto xit
+
+:begin
+rem Generate Unstall.bat
+echo echo off > %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}]" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers] @" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\AFS Client Shell Extension]" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\AFS Client Shell Extension]" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shellex\ContextMenuHandlers] @" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_LOCAL_MACHINE\Software\IBM\WinAfsLoad]" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\afsd.exe]" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved] {DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\AFS Windows 9x Client]" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "-[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\mmap]" >> %2\%3\uninstall.bat
+echo %2\%3\util_cr * "+[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce] doit=%2\%3\runonce.bat" >> %2\%3\uninstall.bat
+echo copy %2\%3\unrunonce %2\%3\runonce.bat >> %2\%3\uninstall.bat
+echo if exist c:\autoafs.bat del c:\autoafs.bat >> %2\%3\uninstall.bat
+echo echo Please reboot your system now! >> %2\%3\uninstall.bat
+
+ECHO del %2\%3\*.tmp >%2\%3\unrunonce
+ECHO del %2\%3\*.dll >>%2\%3\unrunonce
+ECHO del %2\%3\*.exe >>%2\%3\unrunonce
+ECHO del %2\%3\*.ini >>%2\%3\unrunonce
+ECHO del %2\%3\*.vxd >>%2\%3\unrunonce
+ECHO del %2\%3\*.hlp >>%2\%3\unrunonce
+ECHO del %2\%3\*.cnt >>%2\%3\unrunonce
+ECHO del %2\%3\*.doc >>%2\%3\unrunonce
+ECHO del %2\%3\*.info >>%2\%3\unrunonce
+ECHO del %2\%3\*.pif >>%2\%3\unrunonce
+ECHO del %2\%3\tmp\*.dll >>%2\%3\unrunonce
+ECHO del %2\%3\tmp\*.exe >>%2\%3\unrunonce
+echo del %2\%3\runonce.bat >>%2\%3\unrunonce
+
+echo /afs;%2\afscache;%5 >Cache.Info
+echo %4> ThisCell
+
+echo set path=%2\%3;%%path%% > C:\autoafs.bat
+echo set afsconf=%2\%3 >> C:\autoafs.bat
+if exist c:\autoexec.bat echo if exist autoafs.bat autoafs>>c:\autoexec.bat
+
+%2
+if not exist %2\%3\nul mkdir \%3
+if not exist %2\%3\tmp\nul mkdir \%3\tmp
+
+rem copy files over
+set fp=runonce.PIF
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=license.txt
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=util_cr.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=ThisCell
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=cache.info
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=AFSD.PIF
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=CellServDB
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=ReadMe.doc
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=WinAfsLoad.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=afswin9x.HLP
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=afswin9x.CNT
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=unlog.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=afs_shl_ext_1033.dll
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=afsauthent.dll
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=afsshare.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=fs.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=klog.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=kpasswd.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=libosi.dll
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=libafsconf.dll
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=pts.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=tokens.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=afs_shl_ext.dll
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=pthread.dll
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=afsrpc.dll
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=afsd.exe
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\tmp\.
+
+set fp=mmap.vxd
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+set fp=sock.vxd
+if not exist %1\%fp% goto nofile
+copy %1\%fp% %2\%3\.
+
+echo Update Registry
+%1\util_cr * "+[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}] @=AFS Client Shell Extension"
+%1\util_cr * "+[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32] @=%2\%3\afs_shl_ext.dll"
+%1\util_cr * "+[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32] THREADINGMODEL=Apartment"
+%1\util_cr * "+[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers] @=afs_shl_ext"
+%1\util_cr * "+[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\AFS Client Shell Extension] @={DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
+%1\util_cr * "+[HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\AFS Client Shell Extension] @={DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
+%1\util_cr * "+[HKEY_CURRENT_USER\Software\IBM]"
+%1\util_cr * "+[HKEY_CURRENT_USER\Software\IBM\AFS]"
+%1\util_cr * "+[HKEY_CURRENT_USER\Software\IBM\AFS\Window] PowerResumeDelay=hex:14,00,00,00"
+%1\util_cr * "+[HKEY_CURRENT_USER\Software\IBM\AFS\Window] LoginTime=hex:28,00,00,00"
+%1\util_cr * "+[HKEY_CURRENT_USER\Software\IBM\AFS\Security]"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}] @=AFS Client Shell Extension"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32] @=%2\%3\afs_shl_ext.dll"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32] THREADINGMODEL=Apartment"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shellex\ContextMenuHandlers] @="afs_shl_ext"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\IBM\AFS]"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\IBM\AFS\1.00.000]"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\IBM\WinAfsLoad] InstallDir=%2\%3"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\afsd.exe] Path=%2\%3"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\afsd.exe] @=%2\%3\afsd.exe"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved] {DC515C27-6CAC-11D1-BAE7-00C04FD140D2}=AFS Client Shell Extension"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\mmap] STATICVXD=%2\%3\mmap.vxd"
+%1\util_cr * "+[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce] doit=%2\%3\runonce.bat"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\AFS Windows 9x Client] UninstallString=%2\%3\uninstall.bat"
+%1\util_cr * "+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\AFS Windows 9x Client] DisplayName=AFS Windows 9x Client"
+
+echo copy %2\%3\tmp\*.* %2\%3\. > %2\%3\runonce.bat
+ECHO del %2\%3\tmp\*.dll >>%2\%3\runonce.bat
+ECHO del %2\%3\tmp\*.exe >>%2\%3\runonce.bat
+echo del %2\%3\runonce.bat >>%2\%3\runonce.bat
+
+notepad %2\%3\license.txt
+echo You need to reboot the system now
+goto xit
+
+:nofile
+echo Installation incomplete missing file:%1\%fp%
+goto xit
+
+:XIT
+set fp=
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
\ No newline at end of file
--- /dev/null
+REGEDIT4
+[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}]
+@="AFS Client Shell Extension"
+[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32]
+@="c:\\afscli\\afs_shl_ext.dll"
+"THREADINGMODEL"="Apartment"
+[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers]
+@="afs_shl_ext"
+[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\AFS Client Shell Extension]
+@="{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
+[HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\AFS Client Shell Extension]
+@="{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
+[HKEY_CURRENT_USER\Software\IBM]
+[HKEY_CURRENT_USER\Software\IBM\AFS]
+[HKEY_CURRENT_USER\Software\IBM\AFS\Window]
+"PowerResumeDelay"=hex:14,00,00,00
+"LoginTime"=hex:28,00,00,00
+[HKEY_LOCAL_MACHINE\Software\CLASSES\*\shellex\ContextMenuHandlers]
+@="afs_shl_ext"
+[HKEY_LOCAL_MACHINE\Software\CLASSES\*\shellex\ContextMenuHandlers\AFS Client Shell Extension]
+@="{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
+[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}]
+@="AFS Client Shell Extension"
+[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32]
+@="c:\\afscli\\afs_shl_ext.dll"
+"THREADINGMODEL"="Apartment"
+[HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shellex\ContextMenuHandlers]
+@="afs_shl_ext"
+[HKEY_LOCAL_MACHINE\Software\CLASSES\Folder\shellex\ContextMenuHandlers\AFS Client Shell Extension]
+@="{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
+[HKEY_LOCAL_MACHINE\Software\IBM\AFS]
+[HKEY_LOCAL_MACHINE\Software\IBM\AFS\1.00.000]
+[HKEY_LOCAL_MACHINE\Software\IBM\WinAfsLoad]
+"InstallDir"="C:\\Program Files\\AfsCli"
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\afsd.exe]
+"Path"="c:\\afscli"
+@="c:\\afscli\\afsd.exe"
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved]
+"{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"="AFS Client Shell Extension"
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\WinAfsLoad]
+"DisplayName"="WinAfsLoad"
+"UninstallString"="c:\\afscli\\unsetup.bat ;;;"
+[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\mmap]
+"STATICVXD"="c:\\afscli\\mmap.vxd"
+[HKEY_USERS\.DEFAULT\Software\IBM]
+[HKEY_USERS\.DEFAULT\Software\IBM\AFS]
+[HKEY_USERS\.DEFAULT\Software\IBM\AFS\Window]
+"PowerResumeDelay"=hex:14,00,00,00
+"LoginTime"=hex:28,00,00,00
+[HKEY_USERS\.DEFAULT\Software\IBM\AFS\Security]
+[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce]
+"doit"="c:\\afscli\\runonce.bat"
pthread_95.obj: pthread.c
$(C2OBJ) pthread.c -DAFS_WIN95_ENV /Fopthread_95.obj
+install: $(PTHR_DLLFILE) $(LIBINCLUDES)
-install: $(PTHR_DLLFILE) $(PTHR95_DLLFILE) $(LIBINCLUDES)
+install9x: $(PTHR95_DLLFILE) install
pthread.res: pthread.rc AFS_component_version_number.h
$(RC) $*.rc
pthread95.res: pthread95.rc AFS_component_version_number.h
$(RC) $*.rc
+
+clean::
+ $(DEL) /q $(DESTDIR)\lib\win95\*.*
install: $(LIBINCLUDES) $(LIBFILE)
+install9x: install
+
$(LIBFILE): $(LIBOBJS)
$(LIBARCH)
+
+clean::
+ $(DEL) $(LIBINCLUDES)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#include "stdafx.h"
+#ifdef _MFC_VER
+extern "C" {
+#endif
+#include <afs\param.h>
+#include <afs\stds.h>
+#include <afs\kautils.h>
+#include "cm_config.h"
+#include "cmd.h"
+#ifdef _MFC_VER
+ }
+#endif
+#include "api95.h"
+#include "cregkey.h"
+#include "cafs.h"
+#include <Svrapi.h>
+#include "afsmsg95.h"
+
+#include "WinAfsLoad.h"
+
+#define AFS_KERBEROS_ENV
+
+#ifndef KABADARGUMENT
+#undef KABADARGUMENT
+#define KABADARGUMENT 1
+#endif
+#define KLOGEXIT(code) exit(code)
+
+#define LENDIR 128
+
+//#define _DEBUG
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#define HOURSLEFT 24
+
+CProgress::CProgress(CWnd *wnd, UINT mode)
+{
+ m_pWnd=wnd;
+ // you cannot obtain the handle to the window int these routines so you have enough time to create the window
+ PROGRESS(wnd,mode);
+}
+
+CProgress::~CProgress()
+{
+ PROGRESS(NULL,ProgFHide);
+}
+
+void CProgress::SetTitle(const char *t1,const char *t2,const char *t3)
+{
+ char *msg=new char[strlen(t1)+strlen(t2)+strlen(t3)+3];
+ strcpy(msg,t1);
+ strcpy(msg+strlen(t1)+1,t2);
+ strcpy(msg+strlen(t1)+strlen(t2)+2,t3);
+ PROGRESS(msg,ProgFSetTitle);
+}
+
+void CProgress::Next()
+{
+ PROGRESS(m_pWnd,ProgFNext);
+}
+
+void CProgress::Finish()
+{
+ PROGRESS(NULL,ProgFHide);
+}
+
+
+CAfs::~CAfs()
+{
+ // let the OS kill the progress bar thread
+}
+
+void CAfs::FinishProgress()
+{
+ PROGRESS(NULL,ProgFHide);
+}
+
+BOOL CALLBACK CAfs::EnumWindowsProcShutdown(HWND hWnd, LPARAM lParam)
+{
+ CWnd *wnd=CWnd::FromHandle(hWnd);
+ CString msg;
+ CString sFinish;
+ wnd->GetWindowText(msg);
+ if (msg==m_sDosAppName)
+ m_hAfsLoad=hWnd;
+ sFinish.Format("Finished - %s",m_sDosAppName);
+ if (msg==sFinish)
+ m_hAfsLoadFinish=hWnd;
+ return ((m_hAfsLoad==0) && (m_hAfsLoadFinish==0));
+}
+
+BOOL CAfs::Init(CWnd *wnd,CString &msg)
+{
+ ka_Init(0);
+ return TRUE;
+}
+
+HWND CAfs::m_hAfsLoad;
+HWND CAfs::m_hAfsLoadFinish;
+CString CAfs::m_sDosAppName;
+
+BOOL CALLBACK CAfs::EnumWindowsProc(HWND hWnd, LPARAM lParam)
+{
+ CWnd *wnd=CWnd::FromHandle(hWnd);
+ CString msg;
+ wnd->GetWindowText(msg);
+ DWORD dwProcessID;
+ ::GetWindowThreadProcessId (hWnd, &dwProcessID);
+ if (dwProcessID == (DWORD) lParam)
+ {
+ if (msg.IsEmpty()) return TRUE;
+ m_hAfsLoad=hWnd;
+ return FALSE;
+ }
+ return TRUE;
+}
+
+BOOL CAfs::Create(CString &msg,CString sCompName,PROCESS_INFORMATION &procInfo)
+{
+ DWORD rc;
+// lets make sure there are no other instances of the client
+ m_hAfsLoadFinish=m_hAfsLoad=0;
+ EnumWindows (EnumWindowsProcShutdown, (LPARAM) 0); //lets prevent multiple instances!
+ if (m_hAfsLoad)
+ Shutdown(msg);
+ else if (m_hAfsLoadFinish) // SOME REASON THE WINDOW WAS NOT SHUT DOWN, SO LETES KILL IT
+ {
+ ::SendMessage(m_hAfsLoadFinish,WM_CLOSE,0,0);
+ LOG("WM_CLOSE");
+ }
+ CRegkey regkey("AFS\\Window");
+ UINT logintime=0;
+ DWORD size=sizeof(logintime);
+ regkey.GetBinary("LoginTime",(LPBYTE)&logintime,size);
+ if (logintime<=0) {
+#ifdef _DEBUG
+ logintime=10;
+#else
+ logintime=40;
+#endif
+ regkey.PutBinary("LoginTime",(LPBYTE)&logintime,size);
+ }
+ int Pipe = 0;
+ GetStartupInfo(&m_startUpInfo);
+ m_startUpInfo.lpTitle = DOSTITLE;
+ m_startUpInfo.wShowWindow = (CWINAFSLOADAPP->m_bShowAfs) ?SW_SHOW :SW_HIDE;//SW_SHOWMINIMIZED;//SW_HIDE;
+ m_startUpInfo.dwFlags|=STARTF_USESHOWWINDOW;
+ CWINAFSLOADAPP->SetNotifyEventSuspend(); //this needs to be done before createprocess, incase notification occurs before WaitSuspend
+ LOG("Start AFSD Creation");
+ rc = CreateProcess(NULL /*appName 16bit apps should be null*/,CMDLINE, NULL, NULL, FALSE,
+ /*DETACHED_PROCESS |*/ CREATE_NEW_CONSOLE | HIGH_PRIORITY_CLASS /*NORMAL_PRIORITY_CLASS*/,
+ NULL, NULL, &m_startUpInfo, &procInfo);
+
+ LOG("AFSD Creation done - wait for notification");
+ if (!rc) {
+ msg.Format("Error creating AFS Client Console process, Status=0x%0x", GetLastError());
+ return FALSE;
+ }
+ WPARAM wp;
+ CWINAFSLOADAPP->WaitForEvent(logintime*1000,&wp,&msg);
+ switch (wp)
+ {
+ case AFS_EXITCODE_NORMAL:
+ // extract machine name for logon
+ msg=msg.Right(msg.GetLength()-msg.Find('#')-1);
+ m_sMountName.Format("\\\\%s",msg.Left(msg.ReverseFind('#')));
+ if (m_sMountName=="\\\\")
+ {
+ m_sMountName.Format("\\\\%s-AFS",sCompName.Left(11));
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ EnumWindows (EnumWindowsProc, (LPARAM) procInfo.dwProcessId);
+ CString name;
+ int len=0;
+ if (m_hAfsLoad)
+ {
+ len=GetWindowText(m_hAfsLoad,name.GetBuffer(64),63);
+ m_sDosAppName=name;
+ }
+ if (name==DOSTITLE) return TRUE;
+ if ((len==0)||(name==DOSTITLEFINISH) || (name==APPTITLEFINISH))
+ {
+ msg="AFS Client Console did not start properly!";
+ CString temp;
+ Shutdown(temp);
+ return FALSE;
+ }
+ regkey.PutString("Title",name);
+ return TRUE;
+}
+
+BOOL CAfs::CheckNet(CString &msg)
+{
+ TCHAR szDrive[] = TEXT("*:");
+ TCHAR szMapping[ MAX_PATH ] = TEXT("");
+ LPTSTR pszSubmount = szMapping;
+// TCHAR scan[MAX_PATH];
+ DWORD dwSize = MAX_PATH;
+// TCHAR pBuffer[MAX_PATH];
+// wsprintf(scan, "\\\\%s", compname);
+ for (TCHAR chDrive = 'D'; chDrive <= 'Z'; ++chDrive)
+ {
+ szDrive[0]=chDrive;
+ if (WNetGetConnection (szDrive, szMapping, &dwSize) == NO_ERROR)
+ {
+ CHAR *p=strstr(szMapping,m_sMountName);
+ if (p)
+ {
+ p=strrchr(szMapping,'\\')+1;
+ if (!Dismount(msg,szDrive,FALSE))
+ {
+ msg.Format("Drive %s has Open Files",szDrive);
+ return FALSE;
+ }
+ Mount(msg,szDrive,p);
+ }
+ }
+ }
+ return TRUE;
+}
+
+
+BOOL CAfs::Mount(CString &msg,const char *drvLetter,const char *path)
+{
+ char resource[256];
+ NETRESOURCE nr;
+ int oundHome=0;
+ int Pipe = 0;
+ CWait wait; //simple way to set cursor busy
+ memset(&nr, 0, sizeof(NETRESOURCE));
+ ASSERT(strlen(m_sMountName)!=0);
+ wsprintf(resource, "%s\\%s", m_sMountName,path);
+ nr.dwType = RESOURCETYPE_DISK;
+ nr.lpProvider = NULL;
+ nr.lpLocalName = (char *)drvLetter;
+ nr.lpRemoteName = resource;
+ switch (WNetAddConnection2(&nr, 0, 0, 0))
+ {
+ case ERROR_ACCESS_DENIED:
+ msg.Format("Access to the network resource was denied, cannot connect '%s%s'",drvLetter,path);
+ return FALSE;
+ case ERROR_ALREADY_ASSIGNED:
+ msg.Format("Drive %s specified by the path, '%s', is already connected to a network resource",drvLetter,path);
+ return FALSE;
+ case ERROR_BAD_DEVICE:
+ msg.Format("Path '%s' is invalid",path);
+ return FALSE;
+ case ERROR_BAD_NET_NAME:
+ msg.Format("Path '%s' is not acceptable to any network resource provider, either because the resource name is invalid, or because the named resource cannot be located",path);
+ return FALSE;
+ case ERROR_BAD_PROFILE:
+ msg.Format("The user profile is in an incorrect format, cannot add '%s%s'",drvLetter,path);
+ return FALSE;
+ case ERROR_BUSY:
+ msg.Format("The router or provider is busy, possibly initializing. Please retry, cannot add %s%s",drvLetter,path);
+ return FALSE;
+ case ERROR_INVALID_PASSWORD:
+ msg.Format("The specified password is invalid, cannot add '%s%s'",drvLetter,path);
+ return FALSE;
+ case NO_ERROR:
+ return TRUE;
+ default:
+ msg.Format("Network error adding '%s%s'",drvLetter,path);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+BOOL CAfs::Dismount(CString &msg,const char *drvLetter,BOOL force)
+{
+ int Pipe = 0;
+ DWORD ret=-1;
+ CWait wait; //simple way to set cursor busy
+ ret=WNetCancelConnection2(drvLetter,CONNECT_UPDATE_PROFILE,force);
+ switch (ret)
+ {
+ case ERROR_DEVICE_IN_USE:
+ msg.Format("A device is in use and '%s' cannot be disconnected",drvLetter);
+ return FALSE;
+ case ERROR_OPEN_FILES:
+ msg.Format("There are open files on '%s' and cannot be disconnected",drvLetter);
+ return FALSE;
+ case ERROR_NOT_CONNECTED:
+ case NO_ERROR:
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+BOOL CAfs::Authencate(CString &msg,const char * name,const char * password)
+{
+ DWORD rc;
+ char instance[8];
+ char realm[256];
+ int lifetime;
+ char *reason;
+ int oundHome=0;
+ long password_expires;
+ int Pipe = 0;
+ cm_GetRootCellName(m_cCell);
+ strcpy(realm, m_cCell);
+ lifetime = 0;
+ instance[0] = 0;
+ rc = ka_UserAuthenticateGeneral (KA_USERAUTH_VERSION,
+ (PCHAR)name, instance, realm, (PCHAR)password, lifetime,
+ &password_expires, 0, &reason);
+ if (rc) {
+ if (strstr(reason,"skewed"))
+ {
+ char buf[32];
+ if (GetEnvironmentVariable("TZ",buf,32))
+ {
+ msg.Format("Unable to authenticate to AFS because:\n '%s'.\nCheck Enviornment Variable 'TZ=%s', either remove it (See Autoexec.bat) or set it correctly.",reason,buf);
+ return FALSE;
+ }
+ }
+ msg.Format("Unable to authenticate to AFS because:\n '%s'.", reason);
+ return FALSE;
+ }
+
+#ifndef AFS_KERBEROS_ENV
+ if (writeTicketFile) {
+ code = krb_write_ticket_file (realm);
+ if (!Silent) {
+ if (code)
+ com_err (rn, code, "writing Kerberos ticket file");
+ else {
+ m_pParent->Log("Wrote ticket file to /tmp");
+ }
+ }
+ }
+#endif
+ m_tTotalSpanTime=0; //reset total time to 0 so ScanTokens will reset it
+ return ScanTokens(msg);
+}
+
+BOOL CAfs::StartExployer(CString &msg,const char *udrive)
+{
+ DWORD rc;
+ PROCESS_INFORMATION procInfo;
+ STARTUPINFO startUpInfo;
+ int Pipe = 0;
+ int code;
+ WIN32_FIND_DATA FileData;
+ CString dir;
+ dir.Format("%s\\*",udrive);
+ HANDLE hFile= FindFirstFile(
+ dir, // file name
+ &FileData);
+ if (hFile==INVALID_HANDLE_VALUE)
+ {
+ msg.Format("Unable to open Explorer, Drive '%s' is connected but not accessable.",udrive);
+ return FALSE;
+ }
+ FindClose(hFile);
+ char wdir[LENDIR+1];
+ code = GetWindowsDirectory(wdir, sizeof(wdir));
+
+ if (code == 0 || code > sizeof(wdir))
+ strcpy(wdir, "c:\\windows");
+ CString cmdLine;
+ cmdLine.Format("%s\\explorer.exe /n,/e,%s\\",wdir,udrive);
+ GetStartupInfo(&startUpInfo);
+ startUpInfo.lpTitle = NULL;
+ startUpInfo.wShowWindow = SW_SHOWNORMAL;
+ rc = CreateProcess(NULL /*appName*/
+ ,cmdLine.GetBuffer(cmdLine.GetLength())
+ , NULL, NULL, FALSE
+ ,DETACHED_PROCESS | NORMAL_PRIORITY_CLASS
+ ,NULL, NULL, &startUpInfo, &procInfo);
+ if (rc!=0) return TRUE;
+ LPVOID lpMsgBuf;
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL
+ );
+ msg.Format("Unable to open Explorer, %s.",lpMsgBuf);
+ LocalFree( lpMsgBuf );
+ return FALSE;
+}
+
+BOOL CAfs::Shutdown(CString &msg)
+{
+ CWINAFSLOADAPP->ClearNotify();
+ ShutdownAfs();
+ m_hAfsLoadFinish=0;
+ CTime startTime = CTime::GetCurrentTime();
+ CTimeSpan elapsedTime;
+ do
+ {
+ m_hAfsLoad=0;
+ EnumWindows (EnumWindowsProcShutdown, (LPARAM) 0); //lets prevent multiple instances!
+ Sleep(500);
+ elapsedTime= CTime::GetCurrentTime() - startTime;
+ if (elapsedTime.GetTotalSeconds()>10)
+ {
+ msg="AFS Client Console was not terminated properly!";
+ ::ShowWindow(m_hAfsLoad,SW_SHOWNORMAL);
+ return FALSE;
+ }
+ } while (m_hAfsLoad);
+ if (m_hAfsLoadFinish==0)
+ {
+ Sleep(250); //maybe it takes a little time between process kill and window display??
+ EnumWindows (EnumWindowsProcShutdown, (LPARAM) 0); //lets prevent multiple instances!
+ }
+ if (m_hAfsLoadFinish) // SOME REASON THE WINDOW WAS NOT SHUT DOWN, SO LETES KILL IT
+ {
+ ::SendMessage(m_hAfsLoadFinish,WM_CLOSE,0,0);
+ LOG("WM_CLOSE2");
+ }
+ return TRUE;
+}
+
+
+/*
+ struct afsconf_cell {
+ char name[MAXCELLCHARS]; Cell name
+ short numServers; Num active servers for the cell
+ short flags; useful flags
+ struct sockaddr_in hostAddr[MAXHOSTSPERCELL]; IP addresses for cell's servers
+ char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS]; Names for cell's servers
+ char *linkedCell; Linked cell name, if any
+ }
+*/
+
+BOOL CAfs::ScanTokens(CString &msg)
+{
+ int cellNum;
+ int rc;
+ struct ktc_principal serviceName, clientName;
+ struct ktc_token token;
+ cellNum = 0;
+ msg="";
+ while (1) {
+ rc = ktc_ListTokens(cellNum, &cellNum, &serviceName);
+ if (rc == KTC_NOENT) {
+ return TRUE;
+ break;
+ }
+ else if (rc == KTC_NOCM) {
+ return TRUE;
+ }
+ else if (rc) {
+ msg.Format("AFS Scan token error - Unexpected error, code 0x%0x\n", rc);
+ return FALSE;
+ }
+ else {
+ rc = ktc_GetToken(&serviceName, &token, sizeof(token),
+ &clientName);
+ if (rc) {
+ msg.Format("Unexpected error, service %s.%s.%s, code 0x%0x\n",
+ serviceName.name, serviceName.instance,
+ serviceName.cell, rc);
+ return FALSE;
+ }
+ m_dTokenEndTime=token.endTime;
+ if (m_tTotalSpanTime.GetTotalSeconds()==0)
+ m_tTotalSpanTime=::CTime(m_dTokenEndTime)-CTime::GetCurrentTime();
+ }
+ }
+ return TRUE;
+}
+
+UINT CAfs::TestTokenTime(CString &msg)
+{
+ CTimeSpan timeleft=::CTime(m_dTokenEndTime)-CTime::GetCurrentTime();
+#ifdef _DEBUG
+ DWORD dt=timeleft.GetTotalMinutes();
+ DWORD dl=m_tTotalSpanTime.GetTotalMinutes();
+ if (timeleft.GetTotalMinutes()<=m_tTotalSpanTime.GetTotalMinutes()-2)
+ {
+ msg="Authenication Expired: No Time left.";
+ return 2;
+ }
+ msg.Format("Authenication will expire in Hours:%d Minutes:%d",timeleft.GetTotalHours()
+ ,timeleft.GetTotalMinutes()-timeleft.GetTotalHours()*60);
+ return (timeleft.GetTotalMinutes()>(m_tTotalSpanTime.GetTotalMinutes()-1))?0:1;
+#else
+ if (timeleft.GetTotalMinutes()<=0)
+ {
+ msg="Authenication Expired: No Time left.";
+ return 2;
+ }
+ if (
+ (timeleft.GetTotalMinutes()>=(m_tTotalSpanTime.GetTotalMinutes()/7)-1)
+ && (timeleft.GetTotalMinutes()<=(m_tTotalSpanTime.GetTotalMinutes()/7)+1)
+ )
+ {
+ LOG("TimeLeft %d Total Span time %d",timeleft.GetTotalMinutes()
+ ,m_tTotalSpanTime.GetTotalMinutes());
+ return (ScanTokens(msg))?0:-1;
+ }
+ msg.Format("Authenication will expire in Hours:%d Minutes:%d",timeleft.GetTotalHours()
+ ,timeleft.GetTotalMinutes()-timeleft.GetTotalHours()*60);
+ return (timeleft.GetTotalMinutes()>(m_tTotalSpanTime.GetTotalMinutes()/7))?0:1;
+#endif
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#include "stdafx.h"
+#include "cregkey.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+CRegkey::CRegkey(HKEY hKey,const char *subkey,const char *skey)
+{
+ DWORD disposition,result;
+ m_kPkey=m_kSkey=0;
+ result=(RegCreateKeyEx(hKey //HKEY_LOCAL_MACHINE
+ ,subkey //"Software\\IBM"
+ ,0,NULL
+ ,REG_OPTION_NON_VOLATILE
+ ,KEY_ALL_ACCESS,NULL
+ ,&m_kPkey
+ ,&disposition)==ERROR_SUCCESS);
+ if(!result)
+ {
+ AfxMessageBox("AFS Error - Could Not create a registration key!");
+ m_kPkey=0;
+ }
+ result=(RegCreateKeyEx(m_kPkey
+ ,skey
+ ,0,NULL
+ ,REG_OPTION_NON_VOLATILE
+ ,KEY_ALL_ACCESS,NULL
+ ,&m_kSkey,&disposition)==ERROR_SUCCESS);
+ if(!result)
+ {
+ RegCloseKey(m_kPkey);
+ AfxMessageBox("AFS Error - Could Not create a registration key!");
+ m_kPkey=m_kSkey=0;
+ }
+ m_dwIndex=0;
+}
+
+BOOL CRegkey::Enumerate()
+{
+ DWORD result;
+ CString lpName;
+ DWORD dwLen=128;
+ char *p=lpName.GetBuffer(dwLen);
+ FILETIME ftLastWriteTime;
+ result=RegEnumKeyEx(m_kSkey,// handle to key to enumerate
+ m_dwIndex++, // subkey index
+ p, // subkey name
+ &dwLen, // size of subkey buffer
+ NULL, // reserved
+ NULL, // class string buffer
+ NULL, // size of class string buffer
+ &ftLastWriteTime // last write time
+ );
+ switch (result)
+ {
+ case ERROR_NO_MORE_ITEMS:
+ return TRUE;
+ case ERROR_SUCCESS:
+ return TRUE;
+ default:
+ AfxMessageBox("AFS Error - Could Not enumerate a registration key!");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+CRegkey::CRegkey(const char *skey)
+{
+ DWORD disposition,result;
+ m_kPkey=m_kSkey=0;
+ result=(RegCreateKeyEx(HKEY_CURRENT_USER
+ ,"Software\\IBM"
+ ,0,NULL
+ ,REG_OPTION_NON_VOLATILE
+ ,KEY_ALL_ACCESS,NULL
+ ,&m_kPkey
+ ,&disposition)==ERROR_SUCCESS);
+ if(!result)
+ {
+ AfxMessageBox("AFS Error - Could Not create a registration key!");
+ m_kPkey=0;
+ }
+ result=(RegCreateKeyEx(m_kPkey
+ ,skey
+ ,0,NULL
+ ,REG_OPTION_NON_VOLATILE
+ ,KEY_ALL_ACCESS,NULL
+ ,&m_kSkey,&disposition)==ERROR_SUCCESS);
+ if(!result)
+ {
+ RegCloseKey(m_kPkey);
+ AfxMessageBox("AFS Error - Could Not create a registration key!");
+ m_kPkey=m_kSkey=0;
+ }
+}
+
+BOOL CRegkey::GetString(const char *field,CString &buffer,DWORD len)
+{
+ if (m_kSkey==0) return FALSE;
+ UCHAR *pBuffer=(UCHAR *)buffer.GetBuffer(len);
+ DWORD type;
+ if (RegQueryValueEx(m_kSkey
+ ,field,0,&type
+ ,pBuffer
+ ,&len)!=ERROR_SUCCESS)
+ {
+ buffer.ReleaseBuffer();
+ return FALSE; //assume never been set
+ }
+ ASSERT(type==REG_SZ);
+ buffer.ReleaseBuffer(len);
+ return TRUE;
+}
+
+BOOL CRegkey::PutString(const char *field,const char *pBuffer)
+{
+ if (m_kSkey==0)
+ return FALSE;
+ if ((pBuffer)&&(strlen(pBuffer)))
+ return (RegSetValueEx(m_kSkey,field,0,REG_SZ,(CONST BYTE *)pBuffer,strlen(pBuffer))==ERROR_SUCCESS);
+ return (RegSetValueEx(m_kSkey,field,0,REG_SZ,(CONST BYTE *)"",0)==ERROR_SUCCESS);
+}
+
+
+BOOL CRegkey::GetBinary(const char *field,LPBYTE msg,DWORD &len)
+{
+ if (m_kSkey==0)
+ return FALSE;
+ DWORD type;
+ if (RegQueryValueEx(m_kSkey
+ ,field,0,&type
+ ,msg
+ ,&len)!=ERROR_SUCCESS)
+ {
+ return FALSE; //assume never been set
+ }
+ ASSERT(type==REG_BINARY);
+ return TRUE;
+}
+
+BOOL CRegkey::PutBinary(const char *field,LPBYTE msg,DWORD len)
+{
+ CHAR empty[1];
+ empty[0]=0;
+ if (m_kSkey==0)
+ return FALSE;
+ if (msg)
+ return (RegSetValueEx(m_kSkey,field,0,REG_BINARY,msg,len)==ERROR_SUCCESS);
+ return (RegSetValueEx(m_kSkey,field,0,REG_BINARY,(LPBYTE)&empty,0)==ERROR_SUCCESS);
+}
+
+CRegkey::~CRegkey()
+{
+ if (m_kSkey)
+ RegCloseKey(m_kSkey);
+ if (m_kPkey)
+ RegCloseKey(m_kPkey);
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+//Cregkey.h
+
+#ifndef __REGKEY__
+#define __REGKEY__
+
+class CRegkey
+{
+public:
+ CRegkey(HKEY hKey,const char *subkey,const char *skey);
+ CRegkey(const char *);
+ ~CRegkey();
+ HKEY &Getkey(){return m_kSkey;}
+ BOOL GetString(const char *field,CString &buffer,DWORD len);
+ BOOL PutString(const char *field,const char *pBuffer);
+ BOOL GetBinary(const char *field,LPBYTE msg,DWORD &len);
+ BOOL PutBinary(const char *field,LPBYTE msg,DWORD len);
+ BOOL Enumerate();
+private:
+ HKEY m_kPkey;
+ HKEY m_kSkey;
+ DWORD m_dwIndex;
+};
+
+#endif
\ No newline at end of file
--- /dev/null
+>andrew.cmu.edu #Carnegie Mellon University - Computing Services
+128.2.10.11 #vice11.fs.andrew.cmu.edu
+128.2.10.12 #vice12.fs.andrew.cmu.edu
+128.2.10.2 #vice2.fs.andrew.cmu.edu
+128.2.10.28 #vice28.fs.andrew.cmu.edu
+128.2.10.7 #vice7.fs.andrew.cmu.edu
+>cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci.
+128.2.206.130 #cucumber.srv.cs.cmu.edu
+128.2.222.199 #papaya.srv.cs.cmu.edu
+128.2.242.86 #lemon.srv.cs.cmu.edu
+>ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept.
+128.2.129.7 #porok.ece.cmu.edu
+128.2.129.8 #vicio.ece.cmu.edu
+128.2.129.9 #e-xing.ece.cmu.edu
+>athena.mit.edu #MIT/Athena cell
+18.70.0.6 #prill.mit.edu.
+18.145.0.25 #agamemnon.mit.edu.
+18.159.0.34 #chimera.mit.edu.
+>dev.mit.edu #MIT/IS Development cell
+18.86.0.28 #wham.mit.edu.
+18.86.0.50 #hum.mit.edu.
+18.86.0.51 #rattle.mit.edu.
+>net.mit.edu #MIT/Network Group cell
+18.72.1.38 #gracie.mit.edu.
+18.72.0.26 #cetus.mit.edu.
+>sipb.mit.edu #MIT/SIPB cell
+18.181.0.19 #reynelda.mit.edu.
+18.181.0.23 #ronald-ann.mit.edu.
+18.181.0.22 #rosebud.mit.edu.
+>ir.stanford.edu #Stanford University
+171.64.7.222 #afsdb1.stanford.edu
+171.64.7.234 #afsdb2.stanford.edu
+171.64.7.246 #afsdb3.stanford.edu
+>umr.edu #University of Missouri - Rolla
+131.151.1.59 #afs1.umr.edu
+131.151.1.70 #afs6.umr.edu
+131.151.1.146 #afs5.umr.edu
+>dementia.org #Dementia Unlimited
+128.2.35.149 #alycia.dementia.org
+128.2.120.216 #meredith.dementia.org
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// Change.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "WinAfsLoad.h"
+#include "WinAfsLoadDlg.h"
+#include "Change.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CChange dialog
+
+
+CChange::CChange(BOOL change,CWnd* pParent /*=NULL*/)
+ : CDialog(CChange::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CChange)
+ m_sPath = _T("");
+ m_sDescription = _T("");
+ m_bAuto = FALSE;
+ //}}AFX_DATA_INIT
+ m_bChange=change;
+ m_pParent=(CWinAfsLoadDlg *)pParent;
+}
+
+
+void CChange::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CChange)
+ DDX_Control(pDX, IDC_DESCRIPTION, m_cShare);
+ DDX_Control(pDX, IDC_PERSISTENT, m_cAuto);
+ DDX_Control(pDX, IDC_PATH, m_cPath);
+ DDX_Control(pDX, IDC_DRIVE, m_cDrive);
+ DDX_Text(pDX, IDC_PATH, m_sPath);
+ DDV_MaxChars(pDX, m_sPath, 512);
+ DDX_Text(pDX, IDC_DESCRIPTION, m_sDescription);
+ DDV_MaxChars(pDX, m_sDescription, 12);
+ DDX_Check(pDX, IDC_PERSISTENT, m_bAuto);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CChange, CDialog)
+ //{{AFX_MSG_MAP(CChange)
+ ON_WM_HELPINFO()
+ ON_BN_CLICKED(IDC_HELPMAIN, OnHelpmain)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CChange message handlers
+
+void CChange::OnOK()
+{
+ // TODO: Add extra validation here
+ m_cDrive.GetLBText(m_cDrive.GetCurSel(),m_sDrive);
+ m_sDrive=m_sDrive.Left(2);
+ UpdateData(TRUE);
+ if (IsValidSubmountName(m_sPath))
+ {
+
+ if (IsValidShareName(m_sDescription))
+ {
+ CDialog::OnOK();
+ return;
+ }
+ MessageBox("Incorrect Share name","AFS Warning",MB_OK|MB_ICONWARNING);
+ m_cShare.SetFocus();
+ return;
+ }
+ MessageBox("Incorrect Path name","AFS Warning",MB_OK|MB_ICONWARNING);
+ m_cPath.SetFocus();
+}
+
+void CChange::OnCancel()
+{
+ // TODO: Add extra cleanup here
+ m_sDrive=m_sPath=m_sDescription="";
+ CDialog::OnCancel();
+}
+
+BOOL CChange::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // TODO: Add extra initialization here
+ CWnd *win=GetDlgItem(IDOK);
+ if (m_bChange)
+ {
+ if (win)
+ win->SetWindowText("Accept Change");
+ SetWindowText("AFS Change Item");
+ } else {
+ if (win)
+ win->SetWindowText("Add Item");
+ SetWindowText("AFS Add Item");
+ }
+ ListDrive();
+ UpdateData(FALSE);
+ TCHAR szDrive[] = TEXT("*: ");
+ wsprintf(szDrive,"%2s ",m_sDrive);
+ if (m_cDrive.FindString(0,szDrive)!=CB_ERR)
+ m_cDrive.SetCurSel(m_cDrive.FindString(0,szDrive));
+ else {
+ szDrive[3]='*';
+ m_cDrive.SetCurSel(m_cDrive.FindString(0,szDrive));
+ }
+ if (stricmp(m_sDescription,"all")) return TRUE;
+ m_cPath.ModifyStyle(0,WS_DISABLED);
+ m_cShare.ModifyStyle(0,WS_DISABLED);
+ m_cAuto.ModifyStyle(0,WS_DISABLED);
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+VOID CChange::ListDrive()
+{
+ m_pParent->BuildDriveList();
+ POSITION pos=m_pParent->m_Drivelist.GetHeadPosition();
+ while (pos)
+ {
+ m_cDrive.InsertString(-1,m_pParent->m_Drivelist.GetNext(pos));
+ }
+}
+
+BOOL CChange::IsValidShareName(LPCTSTR pszShare)
+{
+ if (!*pszShare)
+ return FALSE;
+ if (stricmp(pszShare,"")==0)
+ return FALSE; //disallow adding a share name of ""
+ for ( ; *pszShare; ++pszShare)
+ {
+ if (!isprint(*pszShare))
+ return FALSE;
+ if (*pszShare == TEXT(' '))
+ return FALSE;
+ if (*pszShare == TEXT('\t'))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+BOOL CChange::IsValidSubmountName (LPCTSTR pszSubmount)
+{
+ if (!*pszSubmount)
+ return FALSE;
+ if (stricmp(pszSubmount,"all")==0)
+ return FALSE; //disallow adding a share name of "all"
+ for ( ; *pszSubmount; ++pszSubmount)
+ {
+ if (!isprint(*pszSubmount))
+ return FALSE;
+ if (*pszSubmount == TEXT(' '))
+ return FALSE;
+ if (*pszSubmount == TEXT('\t'))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+BOOL CChange::OnHelpInfo(HELPINFO* pHelpInfo)
+{
+ // TODO: Add your message handler code here and/or call default
+
+ ::WinHelp(m_hWnd,CWINAFSLOADAPP->m_pszHelpFilePath,HELP_CONTEXT,(m_bChange)?IDH_CHANGE:IDH_ADD);
+ return TRUE;
+// return CDialog::OnHelpInfo(pHelpInfo);
+}
+
+void CChange::OnHelpmain()
+{
+ // TODO: Add your control notification handler code here
+ ::WinHelp(m_hWnd,CWINAFSLOADAPP->m_pszHelpFilePath,HELP_CONTEXT,(m_bChange)?IDH_CHANGE:IDH_ADD);
+
+}
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_CHANGE_H__CF7462A3_F999_11D3_A374_00105A6BCA62__INCLUDED_)
+#define AFX_CHANGE_H__CF7462A3_F999_11D3_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// Change.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CChange dialog
+
+class CChange : public CDialog
+{
+// Construction
+public:
+ CChange(BOOL change,CWnd* pParent = NULL); // standard constructor
+ CString m_sDrive;
+
+// Dialog Data
+ //{{AFX_DATA(CChange)
+ enum { IDD = IDD_AFSCHANGE };
+ CEdit m_cShare;
+ CButton m_cAuto;
+ CEdit m_cPath;
+ CComboBox m_cDrive;
+ CString m_sPath;
+ CString m_sDescription;
+ BOOL m_bAuto;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CChange)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ BOOL m_bChange;
+ void ListDrive();
+ BOOL IsValidSubmountName (LPCTSTR pszSubmount);
+ BOOL IsValidShareName (LPCTSTR pszSubmount);
+ CWinAfsLoadDlg *m_pParent;
+ // Generated message map functions
+ //{{AFX_MSG(CChange)
+ virtual void OnOK();
+ virtual void OnCancel();
+ virtual BOOL OnInitDialog();
+ afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
+ afx_msg void OnHelpmain();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_CHANGE_H__CF7462A3_F999_11D3_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// CommandSettings.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "winafsload.h"
+#include "CommandSettings.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommandSettings dialog
+
+
+CCommandSettings::CCommandSettings(CWnd* pParent /*=NULL*/)
+ : CDialog(CCommandSettings::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CCommandSettings)
+ m_ConnectOnStart = FALSE;
+ m_LogToFile = FALSE;
+ m_LogToWindow = FALSE;
+ m_UserName = _T("");
+ m_uMaxLoginTime = 0;
+ m_uMaxPowerRestartDelay = 0;
+ //}}AFX_DATA_INIT
+}
+
+
+void CCommandSettings::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CCommandSettings)
+ DDX_Control(pDX, IDC_OPTIONLINE, m_cOptionLine);
+ DDX_Control(pDX, IDC_CHECKADVANCED, m_cCheckAdvanceDisplay);
+ DDX_Check(pDX, IDC_CONNECTONSTART, m_ConnectOnStart);
+ DDX_Check(pDX, IDC_LOGTOFILE, m_LogToFile);
+ DDX_Check(pDX, IDC_LOGTOWINDOW, m_LogToWindow);
+ DDX_Text(pDX, IDC_USERNAME, m_UserName);
+ DDX_Text(pDX, IDC_MAXLOGINTIME, m_uMaxLoginTime);
+ DDV_MinMaxUInt(pDX, m_uMaxLoginTime, 1, 300);
+ DDX_Text(pDX, IDC_POWERRESTARTDELAY, m_uMaxPowerRestartDelay);
+ DDV_MinMaxUInt(pDX, m_uMaxPowerRestartDelay, 0, 120);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CCommandSettings, CDialog)
+ //{{AFX_MSG_MAP(CCommandSettings)
+ ON_BN_CLICKED(IDH_SETTINGS, OnSettings)
+ ON_BN_CLICKED(IDC_CHECKADVANCED, OnCheckadvanced)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommandSettings message handlers
+
+void CCommandSettings::OnSettings()
+{
+ // TODO: Add your control notification handler code here
+ ::WinHelp(m_hWnd,CWINAFSLOADAPP->m_pszHelpFilePath,HELP_CONTEXT,IDH_SETTINGS);
+
+}
+
+void CCommandSettings::OnCheckadvanced()
+{
+ // TODO: Add your control notification handler code here
+ if (m_cCheckAdvanceDisplay.GetCheck())
+ {
+ SetWindowPos(&wndTop,0,0,m_OriginalRect.right-m_OriginalRect.left,m_OriginalRect.bottom-m_OriginalRect.top,SWP_NOMOVE|SWP_NOZORDER);
+ } else {
+ SetWindowPos(&wndTop,0,0,m_OriginalRect.right-m_OriginalRect.left,m_DialogShrink,SWP_NOMOVE|SWP_NOZORDER);
+ }
+
+}
+
+BOOL CCommandSettings::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // TODO: Add extra initialization here
+
+ CRect rect;
+ GetWindowRect(&m_OriginalRect);
+ m_cOptionLine.GetWindowRect(&rect);
+ m_DialogShrink=rect.top-m_OriginalRect.top+5; //make it above the edit box
+ SetWindowPos(&wndTop,0,0,m_OriginalRect.right-m_OriginalRect.left,m_DialogShrink,SWP_NOMOVE|SWP_NOZORDER);
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_COMMANDSETTINGS_H__3CDB0E81_7A6D_11D4_A374_00105A6BCA62__INCLUDED_)
+#define AFX_COMMANDSETTINGS_H__3CDB0E81_7A6D_11D4_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// CommandSettings.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommandSettings dialog
+
+class CCommandSettings : public CDialog
+{
+// Construction
+public:
+ CCommandSettings(CWnd* pParent = NULL); // standard constructor
+
+// Dialog Data
+ //{{AFX_DATA(CCommandSettings)
+ enum { IDD = IDD_SETTINGS };
+ CButton m_cOptionLine;
+ CButton m_cCheckAdvanceDisplay;
+ BOOL m_ConnectOnStart;
+ BOOL m_LogToFile;
+ BOOL m_LogToWindow;
+ CString m_UserName;
+ UINT m_uMaxLoginTime;
+ UINT m_uMaxPowerRestartDelay;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CCommandSettings)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ CRect m_OriginalRect;
+ UINT m_DialogShrink;
+ // Generated message map functions
+ //{{AFX_MSG(CCommandSettings)
+ afx_msg void OnSettings();
+ afx_msg void OnCheckadvanced();
+ virtual BOOL OnInitDialog();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_COMMANDSETTINGS_H__3CDB0E81_7A6D_11D4_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// Datalog.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "WinAfsLoad.h"
+#include "WinAfsLoadDlg.h"
+#include "Datalog.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CDatalog dialog
+
+
+CDatalog::CDatalog(CWnd* pParent /*=NULL*/)
+ : CDialog(CDatalog::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CDatalog)
+ m_sEdit = _T("");
+ //}}AFX_DATA_INIT
+ m_pParent=pParent;
+}
+
+
+void CDatalog::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CDatalog)
+ DDX_Control(pDX, IDC_EDIT, m_cEdit);
+ DDX_Text(pDX, IDC_EDIT, m_sEdit);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CDatalog, CDialog)
+ //{{AFX_MSG_MAP(CDatalog)
+ ON_WM_SYSCOMMAND()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CDatalog message handlers
+
+void CDatalog::PostNcDestroy()
+{
+ // TODO: Add your specialized code here and/or call the base class
+
+ delete this;
+}
+
+BOOL CDatalog::Create()
+{
+ return CDialog::Create(IDD, m_pParent);
+}
+
+void CDatalog::OnCancel()
+{
+ ShowWindow(SW_HIDE);
+}
+
+
+BOOL CDatalog::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // TODO: Add extra initialization here
+
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu != NULL)
+ {
+ CString strAboutMenu;
+ strAboutMenu.LoadString(IDM_CLEAR);
+ if (!strAboutMenu.IsEmpty())
+ {
+ pSysMenu->AppendMenu(MF_SEPARATOR);
+ pSysMenu->AppendMenu(MF_STRING, IDM_CLEAR, strAboutMenu);
+ }
+ }
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+
+
+// Responds to system menu calls (best make menu mod 16 value because lower 4 bits are used by os
+// Select Menu item on system menu (title bar) will end up here
+void CDatalog::OnSysCommand(UINT nID, LPARAM lParam)
+{
+ switch (nID & 0xFFF0)
+ {
+ case IDM_VISIBLE: // make current application visible
+ AfxGetApp()->m_pMainWnd->PostMessage(WM_COMMAND,IDM_APP_OPEN,0);
+ return;
+/*
+ CWnd *PrevCWnd, *ChildCWnd;
+ PrevCWnd=CWnd::FromHandle(m_hAfsDialog);
+ DWORD s=PrevCWnd->GetStyle();
+ if (!(WS_VISIBLE & s) )
+ PrevCWnd->ShowWindow(SW_RESTORE); // If iconic, restore the main window
+ ChildCWnd=PrevCWnd->GetLastActivePopup(); // if so, does it have any popups?
+ PrevCWnd->BringWindowToTop(); // Bring the main window to the top
+ if (PrevCWnd != ChildCWnd)
+ ChildCWnd->BringWindowToTop(); // If there are popups, bring them along too!
+*/
+ case IDM_CLEAR:
+ {
+ m_sEdit.Empty();
+ m_sEdit="";
+ UpdateData(FALSE);
+ SendMessage(WM_PAINT);
+ }
+ break;
+ default:
+ CDialog::OnSysCommand(nID, lParam);
+ break;
+ }
+}
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_DATALOG_H__C973E961_F990_11D3_A374_00105A6BCA62__INCLUDED_)
+#define AFX_DATALOG_H__C973E961_F990_11D3_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// Datalog.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CDatalog dialog
+
+class CDatalog : public CDialog
+{
+// Construction
+public:
+ CDatalog(CWnd* pParent = NULL); // standard constructor
+ BOOL Create();
+ void OnCancel();
+
+// Dialog Data
+ //{{AFX_DATA(CDatalog)
+ enum { IDD = IDD_ACTIVITYLOG };
+ CEdit m_cEdit;
+ CString m_sEdit;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CDatalog)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void PostNcDestroy();
+ virtual void OnSysCommand(UINT nID, LPARAM lParam);
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ CWnd* m_pParent;
+
+ // Generated message map functions
+ //{{AFX_MSG(CDatalog)
+ virtual BOOL OnInitDialog();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_DATALOG_H__C973E961_F990_11D3_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// Encription Module
+#include "stdafx.h"
+#include "WinAfsLoad.h"
+#include "WinAfsLoadDlg.h"
+#include "encript.h"
+
+
+CEncript::CEncript(CWinAfsLoadDlg *pParent)
+{
+ m_pParent=pParent;
+ m_hLibrary=LoadLibrary("ADVAPI32.dll");
+ if (m_hLibrary)
+ {
+ m_pCryptAcquireContext=(PCRYPTACQUIRECONTEXT)GetProcAddress(m_hLibrary,"CryptAcquireContextA");
+ m_pCryptCreateHash=(PCRYPTCREATEHASH)GetProcAddress(m_hLibrary,"CryptCreateHash");
+ m_pCryptHashData=(PCRYPTHASHDATA)GetProcAddress(m_hLibrary,"CryptHashData");
+ m_pCryptDeriveKey=(PCRYPTDERIVEKEY)GetProcAddress(m_hLibrary,"CryptDeriveKey");
+ m_pCryptEncrypt=(PCRYPTENCRYPT)GetProcAddress(m_hLibrary,"CryptEncrypt");
+ m_pCryptDecrypt=(PCRYPTDECRYPT)GetProcAddress(m_hLibrary,"CryptDecrypt");
+ m_pCryptDestroyHash=(PCRYPTDESTROYHASH)GetProcAddress(m_hLibrary,"CryptDestroyHash");
+ m_pCryptDestroyKey=(PCRYPTDESTROYKEY)GetProcAddress(m_hLibrary,"CryptDestroyKey");
+ m_pCryptReleaseContext=(PCRYPTRELEASECONTEXT)GetProcAddress(m_hLibrary,"CryptReleaseContext");
+
+ if ((m_pCryptAcquireContext==NULL)
+ ||(m_pCryptCreateHash==NULL)
+ ||(m_pCryptHashData==NULL)
+ ||(m_pCryptDeriveKey==NULL)
+ ||(m_pCryptEncrypt==NULL)
+ ||(m_pCryptDecrypt==NULL)
+ ||(m_pCryptDestroyHash==NULL)
+ ||(m_pCryptDestroyKey==NULL)
+ ||(m_pCryptReleaseContext==NULL)
+ )
+ {
+ LOG("Incorrect ADVAPI32.DLL, Load failure");
+ FreeLibrary(m_hLibrary);
+ m_hLibrary=NULL;
+ }
+ }
+}
+
+CEncript::~CEncript()
+{
+ if (m_hLibrary)
+ FreeLibrary(m_hLibrary);
+ m_hLibrary=NULL;
+}
+
+
+// Encript pPassword
+// if doEncript then encript else de encript
+// on doEncript (true) dwSize sets maxmium size of encription output and pPassword is string to encript
+// and output of encripted string with dwSize set to output size
+// on not doEncript(false) dwSize sets size of pPassword input and pPassword is returned string
+
+BOOL CEncript::Encript(LPCSTR pMachinename,LPCSTR pLoginName,LPCSTR pUsername,PBYTE pPassword,DWORD &dwSize,BOOL doEncript)
+{
+#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
+
+ BOOL bResult;
+ HCRYPTPROV hProv;
+ HCRYPTHASH hHash;
+ HCRYPTKEY hKey;
+ CString sKey;
+ if (m_hLibrary==NULL)
+ {
+ if (doEncript)
+ dwSize=strlen((char *)pPassword);
+ return TRUE;
+ }
+ if(! (*m_pCryptAcquireContext)(
+ &hProv, // Handle to the CSP
+ pLoginName, // Container name
+ MS_DEF_PROV, // Provider name
+ PROV_RSA_FULL, // Provider type
+ 0)) // Flag values
+ {
+ //--------------------------------------------------------------------
+ // Some sort of error occurred in acquiring the context.
+ // Create a new default key container.
+
+ if(!(*m_pCryptAcquireContext) (
+ &hProv,
+ pLoginName,
+ MS_DEF_PROV,
+ PROV_RSA_FULL,
+ CRYPT_NEWKEYSET))
+ {
+ m_pParent->HandleError("Could not create a new key container.\n");
+ }
+ }
+
+ // Obtain handle to hash object.
+ bResult = (*m_pCryptCreateHash)(
+ hProv, // Handle to CSP obtained earlier
+ CALG_MD5, // Hashing algorithm
+ 0, // Non-keyed hash
+ 0, // Should be zero
+ &hHash); // Variable to hold hash object handle
+
+ if (!bResult) { m_pParent->HandleError("Password Encription Error!");return FALSE;}
+ // Hash data.
+ sKey.Format("AFS%s%s%s",pLoginName,pUsername,pMachinename);
+ bResult = (*m_pCryptHashData)(
+ hHash, // Handle to hash object
+ (PBYTE)(const char *)sKey, // Pointer to password
+ dwSize, // Length of data
+ 0); // No special flags
+
+ if (!bResult) { m_pParent->HandleError("Password Encription Error!");return FALSE;}
+
+ // Create key from specified password.
+ bResult = (*m_pCryptDeriveKey)(
+ hProv, // Handle to CSP obtained earlier.
+ CALG_RC4, // Use a stream cipher.
+ hHash, // Handle to hashed password.
+ CRYPT_EXPORTABLE, // Make key exportable.
+ &hKey); // Variable to hold handle of key.
+ if (!bResult) { m_pParent->HandleError("Password Encription Error!");return FALSE;}
+
+// Now encrypt data.
+ if (doEncript)
+ {
+ bResult = (*m_pCryptEncrypt)(
+ hKey, // Key obtained earlier
+ 0, // No hashing of data
+ TRUE, // Final or only buffer of data
+ 0, // Must be zero
+ pPassword, // Data buffer
+ &dwSize, // Size of data
+ dwSize); // Size of block
+ if (!bResult) { m_pParent->HandleError("Password Encription Error!");return FALSE;}
+
+ // save password in encription area
+ } else {
+ bResult = (*m_pCryptDecrypt)(
+ hKey, // Key obtained earlier
+ 0, // No hashing of data
+ TRUE, // Final or only buffer of data
+ 0, // Must be zero
+ pPassword, // Data buffer
+ &dwSize); // Size of data
+ if (!bResult) { m_pParent->HandleError("Password Encription Error!");return FALSE;}
+ }
+// Release hash object.
+ (*m_pCryptDestroyHash)(hHash);
+ (*m_pCryptDestroyKey)(hKey);
+ (*m_pCryptReleaseContext)(hProv,0);
+ return TRUE;
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// Force.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "winafsload.h"
+#include "Force.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CForce dialog
+
+
+CForce::CForce(CWnd* pParent /*=NULL*/)
+ : CDialog(CForce::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CForce)
+ m_sMsg = _T("");
+ //}}AFX_DATA_INIT
+}
+
+
+void CForce::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CForce)
+ DDX_Text(pDX, IDC_STATICMSG, m_sMsg);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CForce, CDialog)
+ //{{AFX_MSG_MAP(CForce)
+ // NOTE: the ClassWizard will add message map macros here
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CForce message handlers
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_FORCE_H__EBCBE049_03C3_11D4_A374_00105A6BCA62__INCLUDED_)
+#define AFX_FORCE_H__EBCBE049_03C3_11D4_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// Force.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CForce dialog
+
+class CForce : public CDialog
+{
+// Construction
+public:
+ CForce(CWnd* pParent = NULL); // standard constructor
+
+// Dialog Data
+ //{{AFX_DATA(CForce)
+ enum { IDD = IDD_DIALOGFORCE };
+ CString m_sMsg;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CForce)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+ // Generated message map functions
+ //{{AFX_MSG(CForce)
+ // NOTE: the ClassWizard will add member functions here
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_FORCE_H__EBCBE049_03C3_11D4_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+:Base afswin9x
+:Title Access Control
+1 Information
+2 AFS Client Overview=IDH_MAIN@afswin9x.hlp
+2 AFS File Space=Terms@afswin9x.hlp
+2 AFS File System Properties=Properties@afswin9x.hlp
+1 AFS Client Operation
+2 How To Use=HowToUse@afswin9x.hlp
+2 AFS Client - Connect / Disconnect=HowToUse@afswin9x.hlp
+2 Miminize (Iconize)=Iconize@afswin9x.hlp
+2 Drive Letter Map Point - Connect/Disconnect=AdvancedOptions@afswin9x.hlp
+2 Advanced Options=AdvancedOptions@afswin9x.hlp
+2 Change Drive Letter Map Point=IDH_CHANGE@afswin9x.hlp
+2 Add Drive Letter Map Point=IDH_ADD@afswin9x.hlp
+2 Setting=IDH_SETTINGS@afswin9x.hlp
+1 AFS File System Properties
+2 AFS File Properties=Properties@afswin9x.hlp
+2 Access Control Lists..=SET_AFS_ACL_ENTRY_HELP_ID@afswin9x.hlp
+2 Volumn/Partition Information=VOLUME_INFO_HELP_ID@afswin9x.hlp
+2 Mount Point=MountPoints@afswin9x.hlp
+2 Flush Volume=FlushVolume@afswin9x.hlp
+2 Flush File/Dir=FlushFileDir@afswin9x.hlp
+2 Show File Servers=SHOW_FILE_SERVERS_HELP_ID@afswin9x.hlp
+2 Show Cell=SHOW_CELL_HELP_ID@afswin9x.hlp
+2 Show Server Status=SERVER_STATUS_HELP_ID@afswin9x.hlp
+2 Mount Point
+3 Show=MOUNT_POINTS_HELP_ID@afswin9x.hlp
+3 Remove=REMOVE_MOUNT_POINTS_HELP_ID@afswin9x.hlp
+3 Make=MAKE_MOUNT_POINT_HELP_ID@afswin9x.hlp
+1 Miscellaneous
+2 Trouble Shooting=TroubleShooting@afswin9x.hlp
+2 Miscellaneous Commands=Miscellaneous@afswin9x.hlp
+2 Contact Information=ContactInfo@afswin9x.hlp
--- /dev/null
+; This file is maintained by HCW. Do not modify this file directly.
+
+[OPTIONS]
+COMPRESS=12 Hall Zeck
+LCID=0x409 0x0 0x0 ; English (United States)
+REPORT=Yes
+CONTENTS=IDH_MAIN
+TITLE=AFS Windows' Client
+CNT=afswin9x.cnt
+COPYRIGHT=Version 1.17.0
+HLP=afswin9x.hlp
+
+[FILES]
+afswin9x.rtf
+
+[MAP]
+ADD_ACL_ENTRY_HELP_ID=20
+ADD_SUBMOUNTS_HELP_ID=45
+AUTEHTICATION_HELP_ID=16
+COPY_ACL_HELP_ID=21
+DISCARD_TOKENS_HELP_ID=18
+EDIT_PATH_NAME_HELP_ID=46
+GET_TOKENS_HELP_ID=17
+IDH_ADD=1137
+IDH_CHANGE=1138
+IDH_MAIN=1140
+IDH_SETTINGS=1293
+MAKE_MOUNT_POINT_HELP_ID=35
+MOUNT_POINTS_HELP_ID=33
+PARTITION_INFO_HELP_ID=28
+REMOVE_MOUNT_POINTS_HELP_ID=34
+SERVER_STATUS_HELP_ID=40
+SET_AFS_ACL_ENTRY_HELP_ID=19
+SHOW_CELL_HELP_ID=39
+SHOW_FILE_SERVERS_HELP_ID=38
+SUBMOUNTS_HELP_ID=44
+VOLUME_INFO_HELP_ID=27
+
+[WINDOWS]
+Main="AFS File System (Ufilier)",(652,101,360,599),27904,(r14876671),(r12632256),f3
+
+[CONFIG]
+BrowseButtons()
--- /dev/null
+{\rtf1\ansi\ansicpg1252\uc1 \deff1\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
+{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}
+{\f149\froman\fcharset238\fprq2 Times New Roman CE;}{\f150\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f152\froman\fcharset161\fprq2 Times New Roman Greek;}{\f153\froman\fcharset162\fprq2 Times New Roman Tur;}
+{\f154\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f155\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f156\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f157\fswiss\fcharset238\fprq2 Arial CE;}
+{\f158\fswiss\fcharset204\fprq2 Arial Cyr;}{\f160\fswiss\fcharset161\fprq2 Arial Greek;}{\f161\fswiss\fcharset162\fprq2 Arial Tur;}{\f162\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f163\fswiss\fcharset178\fprq2 Arial (Arabic);}
+{\f164\fswiss\fcharset186\fprq2 Arial Baltic;}{\f165\fmodern\fcharset238\fprq1 Courier New CE;}{\f166\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f168\fmodern\fcharset161\fprq1 Courier New Greek;}{\f169\fmodern\fcharset162\fprq1 Courier New Tur;}
+{\f170\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f171\fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f172\fmodern\fcharset186\fprq1 Courier New Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;
+\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;
+\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{
+\s1\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\uldb\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 1;}{
+\s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 2;}{
+\s3\qc \li0\ri2340\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin2340\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 3;}{
+\s4\qc \li0\ri5580\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin5580\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 4;}{
+\s5\qc \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 5;}{\*\cs10 \additive Default Paragraph Font;}{
+\s15\qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 Title;}{\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext16 footnote text;}{\*\cs17 \additive \super \sbasedon10 footnote reference;}{\*\cs18 \additive \ul\cf12 \sbasedon10 FollowedHyperlink;}{
+\s19\ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext19 Body Text 2;}{\s20\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext20 Body Text;}{\*\cs21 \additive \ul\cf2 \sbasedon10 Hyperlink;}{\s22\ql \li0\ri0\widctlpar\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext22 header;}}{\*\listtable{\list\listtemplateid929089378\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid205610547}{\list\listtemplateid1710930326\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid244219890}{\list\listtemplateid-773692958\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid266545100}{\list\listtemplateid61766012\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid459223963}{\list\listtemplateid23375172\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1080\jclisttab\tx1080 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1800\jclisttab\tx1800 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2520\jclisttab\tx2520 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3240\jclisttab\tx3240 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3960\jclisttab\tx3960 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4680
+\jclisttab\tx4680 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5400\jclisttab\tx5400 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6120\jclisttab\tx6120 }{\listname ;}\listid521865045}{\list\listtemplateid1910423284\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid548762669}{\list\listtemplateid1766887180\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid636036162}{\list\listtemplateid110555416\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid681200174}{\list\listtemplateid664591418\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid782305106}{\list\listtemplateid-2066942012\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1070153243}{\list\listtemplateid-1453146342\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698703\'02\'01.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1149201680}{\list\listtemplateid-409596436\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1080\jclisttab\tx1080 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1800\jclisttab\tx1800 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2520\jclisttab\tx2520 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3240\jclisttab\tx3240 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3960\jclisttab\tx3960 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4680
+\jclisttab\tx4680 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5400\jclisttab\tx5400 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6120\jclisttab\tx6120 }{\listname ;}\listid1328248258}{\list\listtemplateid-235912772\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1388066525}{\list\listtemplateid-848244788\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1403986594}{\list\listtemplateid-1489762306\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1434478203}{\list\listtemplateid-1713185060\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1446118011}{\list\listtemplateid877529172\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040
+\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
+\fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1547526921}{\list\listtemplateid-1137307152\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698703\'02\'00.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0
+{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-180\li2160\jclisttab\tx2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-180\li4320\jclisttab\tx4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
+\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li5040\jclisttab\tx5040 }{\listlevel\levelnfc4\levelnfcn4
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc2
+\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-180\li6480\jclisttab\tx6480 }{\listname
+;}\listid1647008142}{\list\listtemplateid-2124356362\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr
+\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2
+\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693
+\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext
+\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }
+{\listname ;}\listid1656912505}{\list\listtemplateid388774866\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr
+\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2
+\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693
+\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext
+\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }
+{\listname ;}\listid1703745684}{\list\listtemplateid-1569400874\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3
+\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers
+;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693
+\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext
+\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }
+{\listname ;}\listid1764640180}{\list\listtemplateid-2060914188\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3
+\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li720\jclisttab\tx720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers
+;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li1440\jclisttab\tx1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693
+\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2160\jclisttab\tx2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext
+\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li2880\jclisttab\tx2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
+\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li3600\jclisttab\tx3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
+\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li4320\jclisttab\tx4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5040\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23
+\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }
+{\listname ;}\listid1797527050}}{\*\listoverridetable{\listoverride\listid244219890\listoverridecount0\ls1}{\listoverride\listid782305106\listoverridecount0\ls2}{\listoverride\listid205610547\listoverridecount0\ls3}{\listoverride\listid1434478203
+\listoverridecount0\ls4}{\listoverride\listid1797527050\listoverridecount0\ls5}{\listoverride\listid1446118011\listoverridecount0\ls6}{\listoverride\listid1070153243\listoverridecount0\ls7}{\listoverride\listid1403986594\listoverridecount0\ls8}
+{\listoverride\listid521865045\listoverridecount0\ls9}{\listoverride\listid1328248258\listoverridecount0\ls10}{\listoverride\listid1703745684\listoverridecount0\ls11}{\listoverride\listid1149201680\listoverridecount0\ls12}{\listoverride\listid1547526921
+\listoverridecount0\ls13}{\listoverride\listid1764640180\listoverridecount0\ls14}{\listoverride\listid1647008142\listoverridecount0\ls15}{\listoverride\listid1388066525\listoverridecount0\ls16}{\listoverride\listid636036162\listoverridecount0\ls17}
+{\listoverride\listid548762669\listoverridecount0\ls18}{\listoverride\listid681200174\listoverridecount0\ls19}{\listoverride\listid1656912505\listoverridecount0\ls20}{\listoverride\listid459223963\listoverridecount0\ls21}{\listoverride\listid266545100
+\listoverridecount0\ls22}}{\info{\title Afs Properities Page}{\author Shyh-Wei Luan}{\operator Shyh-Wei Luan}{\creatim\yr2000\mo8\dy16\hr17\min2}{\revtim\yr2001\mo4\dy25\hr14\min21}{\version167}{\edmins5896}{\nofpages19}{\nofwords4208}{\nofchars23990}
+{\*\company IBM}{\nofcharsws0}{\vern8247}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1800\dgvorigin1440\dghshow1\dgvshow1
+\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule \fet0\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl {\*\pnseclvl1
+\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5
+\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
+{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s1\qc \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0
+\f1\fs20\uldb\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{
+ IDH_MAIN}}${\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super $}{ }{\fs24 WhatisUfiler}}#{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ }{\fs24 WhatisUfiler}}}{\b\ulnone Overview}{\ulnone
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \s5\qc \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel4\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Welcome to the Open AFS Client for Windows 95/98}{\b0
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par \{bmlt icon.bmp\} }{\b AFS File System
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par AFS}{{\field{\*\fldinst SYMBOL 226 \\f "Symbol" \\s 10}{\fldrslt\f3\fs20}}}{
+ is a distributed file system that provides secure, reliable access to information across an enterprise. By seamlessly uniting the directories and files on individual file server machines into one file system accessible from any desktop, AFS presents user
+s with a single file space independent of machine boundaries.
+\par
+\par AFS offers several advantages. It improves the availability of files by employing client-side caching and replication of frequently accessed data across multiple file servers. AFS provides powe
+rful security to protect the information stored in the file space. In addition, AFS is highly scalable. Virtually unlimited additional server and client machines can be added as needed to an AFS configuration with little impact on existing server and clie
+nt machines. This enables the file system to grow with the enterprise.
+\par
+\par }{\b AFS Client for Windows 95/98}{
+\par
+\par This client allows you to access files on sites stored all over the Internet as though the files were residing on your local machine. You can store your o
+wn files on the Internet to share with others, and can limit access to your files to specific users or groups of users. You can browse through the different AFS sites (known as cells) from a single file tree and use standard Windows programs such as Expl
+orer to copy and manipulate files. You can open files stored on the Internet directly from Windows applications.
+\par
+\par By default, one drive letter will be assigned on your machine, Z. The Z: drive will be the root of the AFS tree, allowing you to browse all sites that have AFS servers available. (Note: driver letters are configurable.)
+\par
+\par Drive Letter Map Points are locations in the AFS file system that a user chooses to assign a drive letter. Any AFS directory can serve as a Drive Letter Map Point.
+\par
+\par This client is based on AFS version 3.5.
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {System Requirements}{\b0
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par IBM compatible PC running Windows 95 or 98
+\par 16 MB RAM
+\par 20 MB free disk space
+\par Client for Microsoft Networks must be installed
+\par TCP/IP protocol stack must be installed
+\par
+\par The AFS Client has a Windows GUI application, AFS Control Panel (}{\i WinAFSLoad.exe}{) and a hidden AFS Client Console (}{\i AFSD.EXE}{).
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ Terms}}}{AFS File Space}{\b0
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {AFS, just like any Window\rquote s file system, uses a hierarchical file structure \endash
+ a tree. By convention, /}{\i afs}{ is the root. The next level of directories consists of cells. Cells are sub-trees of the AFS file space, consisting of related directories and files. The directories and files under /afs make up the AFS file space.
+
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Cells
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par A cell in the AFS file space acts as an administrative domain. A cell\rquote
+s domain can consist of a company, a university department, or any defined group of users. Each cell is autonomously administered; its administrators determine how workstations are configured and how much storage
+ space is available to each user. Each Cell can also connect with the file space of the other cells running AFS. The cell controlling the workstation you are using is called your local cell.
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Volumes
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par AFS divides disks partitions into subsections called volumes. A volume houses a sub-tree of related files and directories. Most AFS cells use one volume for each user\rquote s home directory \endash all files and subdirectories in a user\rquote
+s home directory are typically stored together on one file server machine, in one volume on one of the server\rquote s disk partitions.
+\par
+\par You do not have to know which file server machine houses your volume, because AFS finds yours files for you automatically. If you are interested, you can find your volume location (See }{\uldb Volume/Partition}{\v VOLUME_INFO_HELP_ID}{
+). Volumes have a size limit assigned by the system administrator.
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Drive Letter Map Points
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+Access to AFS directories are provided through Drive Letter Map Points. Default map point Z is mapped to the AFS tree. This drive letter can be used to access all AFS directories. For the users\rquote
+ convenience, additional Drive Letter Map Points can be specified to any directory within the AFS tree.
+\par
+\par }{\b Mount Points
+\par }{
+\par }{\cf1 An AFS volume can be mounted to an AFS directory and mounted volume will appear as a sub-directory to the AFS directory.
+\par }{
+\par For example, a user named terry in cell comp.com has a volume named user.terry. A Mount Point exists in the /}{\i afs/comp.com/usr}{ directory named terry and it points to the volume user.terry. When you use any of the subdi
+rectories of terry, you are still using the volume user.terry, and you are accessing files on the file server where user.terry volume is stored.
+\par
+\par }{\b File Space Extension}{
+\par
+\par The AFS file space is an extension of a local machine\rquote
+s file space; that is, AFS directories appear as local directories under a drive Letter. AFS allows many users to share common files; that is, their drive letters are assigned to the same Drive Letter Map Point.
+\par
+\par }{\b Access Control Lists (ACLs\rquote )
+\par }{
+\par AFS uses access control lists (ACLs\rquote
+) to determine who can access the information in the AFS file space. An ACL exists for each directory in the AFS file system; specifying what actions different users can perform on that directory and its files. The owner of the di
+rectory can determine who appears on the access control list and what privileges they have. Individual users own their home directories and their subdirectories.
+\par
+\par }{\b Access Protection Groups
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par An access control list group is a defined as a list of individual users that you can place in the access control lists (ACLs\rquote ) of your directories. ACLs\rquote
+ allow you to grand the same access rights to a number of people all at once, making user maintenance much easier. Instead of adding (and removing) individuals separately, users can be added and removed from ACLs\rquote
+, updating all the directories at once. When you create a group you automatically become its owner. A group\rquote s owner is the only one allowed to administer the group: add or remove members, rename it, change its owner, or delete it.
+\par \page }{\cs17\super ${\footnote \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super $}{ HowToUse}}+{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super +}{ AdvancedOption:0}}#{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ HowToUse}}}{\b How to use}{
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Startup}{\b0
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+After you have completed installation you can use the AFS Client to connect to an AFS file system. Start up the }{\i WinAFSload}{ application (double click).
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Connect}{\b0
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Once the AFS Control Panel dialog box appears, fill in your User Name and Password then choose }{\b\i
+<Connect>}{. (NOTE: your AFS system administrator assigns valid usernames and passwords; however, you can change your }{\i password}{ in }{\uldb Miscellaneous}{\v Miscellaneous}{)
+\par
+\par The }{\b\i <Connect}{\b >}{ button will initiate connection to the AFS server, assign a drive letter to the family of AFS volumes (default Z).
+\par
+\par After connection the }{\b\i <Connect>}{ button will turn into }{\b\i <Disconnect>}{, the }{\b\i <Exit>}{\i }{button will turn into }{\b\i <Cancel>}{\i }{and the }{\b\i <ReAuthenicate>}{ button will become active.
+\par
+\par }{\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ Iconize}}}{When connection is active }{\b\i <Disconnect>}{
+ will reverse the process. }{\b\i <Cancel>}{ will iconize the application. }{\b\i <ReAuthenicate>}{ with reset the security timer.
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {ReAuthenicate}{\b0
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\i <ReAuthenicate>}{ will estab
+lish a new security token. Each authenticated user is assigned a security token that contains security information and expiration dates. When this token expires, the drive associated with the Drive Letter Map Point is no longer connected, you cannot rea
+d or write any files associated with this drive letter; that is, any attempts to access the assigned drive letter will result in \lquote access errors\rquote .
+\par
+\par You can reset the security timer, }{\b\i <ReAuthenicate>}{, as many times you like, even if the timer has expired.
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Cancel (Minimization)}{\b0
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {While The AFS File System is connected you may iconize the AFS Control Panel by selecting the }{\b\i
+<Cancel>}{ button or by selecting the Window close, the }{\b X}{ at the top right of the dialog box. The application will shrink to an icon on the Task bar. You can still operate the AFS Control Panel from the task bar by \lquote right clicking\rquote
+ on the icon that is located on the taskbar (usually located on the lower right of the desktop).
+\par \{bmlt icon.bmp\}
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Username and Password}{\b0
+\par }\pard\plain \s19\ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {The User Name and Password can be saved as a default setting by selecting the }{\b\i Save Password}{
+ check box. If this box is checked the Username and Password will be saved on your hard drive (encrypted) when you exit the AFS Control Panel. The Username and Password will be restored to th
+e saved values each time you restart your AFS Control Panel application. HINT: You can remove your Username and Password from the hard drive by clearing the two fields, checking the }{\b\i Save Password}{ check box and then selecting }{\b\i <Exit>}{.
+
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b Drive Assignments (Drive Letter Map Points)}{
+\par }\pard \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 {From the }{\b\i Advanced Options}{
+ form you can map any AFS directory to a drive letter, connect and disconnect a Drive Letter Map Point. From the main dialog box, Advanced Options can be viewed by clicking the }{\b Advanced Option}{ check box. See }{\uldb Advanced Options}{\v
+AdvancedOptions}{.
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b Settings}{
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Select }{\b\i <Settings>}{ to set connection and various data logging options. See }{\uldb Settings}{
+\v IDH_SETTINGS}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Advanced Options}{\b0
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {With }{\b Advanced Options}{ checked you can connect or disconnect various drive letters to the AFS fi
+le system. You can also edit Drive Letter Map Point. See }{\uldb Advanced Options}{\v AdvancedOptions}{.
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Property Menus}{\b0
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {See }{\uldb AFS File Properties
+\par
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Power Suspend/Resume
+\par }\pard\plain \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Before power suspend is completed the AFS Control Panel will suspend the }{\v Propertiessuspendsu}{
+AFS connection. When Windows resumes power the AFS Control Panel will establish the AFS connection and re-authenticate the user. You may notice an extra step in connection process while AFS Control Panel waits for the Window\rquote s OS to stabilize.
+
+\par
+\par The power suspend/resume cycle does not require operator intervention, the AFS connection will return to the same state it was before power suspension.
+\par
+\par HINT: Windows 98 will prevent power suspend if there are any open AFS files.
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\page }{\cs17\super +{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super +}{ AdvancedOption:1}}#{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\cs17\super #}{ AdvancedOptions}}${\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super $}{ Advanced Options}}}{\b Advanced Options}{
+
+\par }\pard \ql \li0\ri2700\widctlpar\aspalpha\aspnum\faauto\adjustright\rin2700\lin0\itap0 {
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {From the AFS Control Panel dialog box checking the }{\b\i Advanced Options}{ will display an extension to the AFS Control Panel dialog box. See }{\i Advanced Options}{
+ figure below.
+\par
+\par
+\par }\pard\plain \s3\qc \li0\ri2340\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin2340\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Advanced Options Table
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\{bml advanced.mrb\}
+\par
+\par There are 4 columns:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls13\adjustright\rin0\lin720\itap0 {\b Drive}{
+: This shows which drives are connected. Checking a box will connect a new drive and unchecking it will disconnect. In this example there are two drives connected: Z & U.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b AFS Path}{: This is the Drive Letter Map Point that is associated with the drive letter.
+\par {\listtext\pard\plain\f3\fs28 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b\fs28 *}{
+: All drives with an asterisk will be automatically connected when AFS Client is connected. In this example both Z and U drives will be connected during the connection process.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls14\adjustright\rin0\lin720\itap0 {\b Share Name}{
+: the share name is used by Windows to identify a particular row in the Advanced Options table. The description must be unique for entry.
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par From this dialog you may highlight a particular drive assignment by clicking on its row. Once it\rquote s highlighted, you may choose to }{\b\i <Remove>}{ or }{\b\i <Change>}{ the highlighted entry. See }{\uldb Change Drive Letter Map Point}{\v
+IDH_CHANGE}{. In this example the T drive is highlighted.
+\par
+\par Clicking on the }{\b\fs24 {\field{\*\fldinst SYMBOL 240 \\f "Symbol" \\s 12}{\fldrslt\f3\fs24}}}{ with a }{\b {\field{\*\fldinst SYMBOL 214 \\f "Symbol" \\s 10}{\fldrslt\f3\fs20}}}{\b }{will disconnect
+the Drive Letter Map Point. Clicking on an empty box will connect it (and display a }{\b {\field{\*\fldinst SYMBOL 214 \\f "Symbol" \\s 10}{\fldrslt\f3\fs20}}}{\b }{
+in the box). In this example clicking on the check box next to U: will cause U to be connected. HINT: you can disconnect using the tools
+associated with the Explorer and that activity will be reflected in this table, if the operation involves a connected Drive Letter Map Point.
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {To add a new Drive Letter Map Point, select the }{\b\i <Add>}{\b }{button, see }{\uldb
+Add Drive Letter Map Point.}{\v IDH_ADD}{
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\page }{\cs17\super +{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super +}{ AdvancedOption:3}}${\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\cs17\super $}{ Add Mount Point}}#{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ IDH_ADD}}}{\b Add Drive Letter Map Point}{
+
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par The }{\i AFS Add Item}{ dialog box allows the user to add new Drive Letter Map Points.
+\par
+\par Using the AFS Control Panel to define a map point is different than using AFS file properties menu with Window\rquote s Explorer(See }{\uldb Properties}{\v Properties}{
+). AFS Control Panel can connect a Drive Letter Map Point to a drive letter; whereas, using the AFS file properties menu with Window\rquote s Explorer to specify a Mount Point that will make an AFS volume appear a
+s a sub-directory within your AFS directory.
+\par
+\par In this form you will enter the following information:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls8\adjustright\rin0\lin720\itap0 {\b Drive}{
+: Choose a drive letter from the list. If the drive is already assigned you are notified by an * next to the drive letter. The only restriction is you can\rquote t use a drive letter assigned to a hard drive.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b AFS Path}{: Enter AFS directory location.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b Share name}{: the share name is used by Windows to identify a particular connection. This value must be unique for each entry in the table.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b Restore Drive Letter Map Point}{ check box: With this box checked, when the AFS Client is connected the any entries checked will be automatically connected!
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par After you have completed filling out the form, select }{\b\i <Add Item>}{; the new entry will be appended to the Advanced Options table. This will only change the table; it does not connect or disconnect any Drive Letter Map Points.
+\par
+\par HINT: you cannot change a drive assignment while it is connected.
+\par
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\page }{\cs17\super +{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super +}{ AdvancedOption:4}}${\footnote \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\cs17\super $}{ Change Mount Point}}#{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ IDH_CHANGE}}}{\b Change Drive Letter M
+ap Point}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par From the AFS Change Item form you can edit the following information:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls8\adjustright\rin0\lin720\itap0 {\b Drive}{
+: Choose a drive letter from the list. Drives with an asterisk (*) are already in use. The only restriction is that you can\rquote t use drive letters that are assigned to ha
+rd drives. HINT: while connected to the AFS File System, you cannot connect the same drive letter twice.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b AFS Path}{: Enter your AFS directory location. For example: the previous example N: drive had two entries one the AFS Path: }{\b /AFS/k56/proj/idrive/test/u578}{.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b Share name}{
+: Enter a unique share name. This name is used to identify the mapping instructions. It needs to be unique. The value is NOT verified to be unique; it is your responsibility!
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b Connect Drive Letter Map Point when AFS Connected}{
+ check box: With this box checked, when the AFS Client is connected all checked Drive Letter Map Points will be automatically connected!
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par
+\par After you have completed the form, select }{\b\i <Accept Change>}{ to change this entry in the Advanced Options Table. This will only change the table; it does not imply the drive will be immediately connected.
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\page }{\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ Miscellaneous}}}{\b Miscellaneous}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\b
+\par }{You can use command line options control the AFS Control Panel operation. During client loading the client will respond to these options.
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+For example, if you wish to place a short cut on your Desktop that automatically connects to a particular username password you could define the program shortcut with the following:
+\par }\pard\plain \s20\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\fs24
+\par }{\b\fs16 C:\\AFSCLI\\WinAFSload.EXE \endash connect \endash userid:your_user_name \endash password:your_password
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b
+\par List of Command Line Options for WinAFSload:
+\par
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-1440\li1620\ri0\widctlpar\jclisttab\tx360\aspalpha\aspnum\faauto\ls6\adjustright\rin0\lin1620\itap0 {\b -show\tab }{
+Show AFS Client Console (background activity). It is not recommended that you use this option; it can cause system instabilities if it is used improperly.}{\b
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}-connect:\tab }{After the client is loaded, automatically connect using the default }{\i userid}{ and }{\i password}{ (Also see }{\uldb Settings}{\v IDH_SETTINGS}{). }{\b
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}-userid:\tab }{Change default }{\i userid.}{ (This does not change the stored username on the hard Drive.)}{\b
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}-password:\tab }{Change default }{\i password.}{ (This does not change the stored }{\i password}{ on the hard Drive.)}{\b
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\b
+\par }{HINT: If you choose to automatically connect and do not specify }{\i userid}{ or }{\i password}{ then the default }{\i userid}{ and }{\i password}{ saved on the hard drive will be used.
+\par }{\b
+\par
+\par }{\cs17\b\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ CommandLineTools}}}{\b Command Line Tools
+\par
+\par }{Command Line Tools are used to manually control AFS Control Panel assignments. These are used to authenticate multiple cells and other advanced operations. These commands are entered from a DOS window or Run from the Windows Start menu.
+\par
+\par For full documentation see }{\uldb Contact Information}{\v ContactInfo}{.}{\f0
+\par
+\par }{These tools are located in the AFS installed directory (default C:\\AFSCLI\\).
+\par
+\par {\listtext\pard\plain\s22 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \s22\ql \fi-1620\li1620\ri0\widctlpar\jclisttab\tx360\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin1620\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\b klog.exe:\tab }{Authenticate a user to a cell, e.g. "klog joeuser@mycell.com"
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \ql \fi-1620\li1620\ri0\widctlpar\jclisttab\tx360\tx1980\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin1620\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\b unlog.exe:\tab }{Unauthenticate a cell.
+\par {\listtext\pard\plain\s20 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \s20\ql \fi-1620\li1620\ri0\widctlpar\jclisttab\tx360\tx1980\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin1620\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b tokens.exe}{:\tab List which tokens you have (cells that have authenticated) and their expiration times.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \ql \fi-1620\li1620\ri0\widctlpar\jclisttab\tx360\tx1980\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin1620\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\b kpasswd.exe}{:Change your password for the specified cell.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b symlink.exe}{:\tab Create a symbolic link , e.g. "symlink make dest src" makes a link called "dest" pointing to file "src".
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b fs.exe:\tab }{
+This command is used for a number of file server functions. Type "fs help" for a list, and then "fs help function" to get detailed help for that function. See the documentation for more info.
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard\plain \s20\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {The most commonly used functions are:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \ql \fi-360\li360\ri0\widctlpar\jclisttab\tx360\tx3060\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin360\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b
+fs help}{:\tab list functions
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li360\ri0\widctlpar\jclisttab\tx360\tx2340\tx3060\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin360\itap0 {\b fs listacl}{ <directory> :\tab \tab
+show directory access control list
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li360\ri0\widctlpar\jclisttab\tx360\tx1980\tx3060\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin360\itap0 {\b fs setacl}{ <diretory> <acl> :\tab
+set directory access control list
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-3240\li3240\ri0\widctlpar\jclisttab\tx360\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin3240\itap0 {\b fs listquota}{ <directory> :\tab show directory disk quota.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-3240\li3240\ri0\widctlpar\jclisttab\tx360\jclisttab\tx540\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin3240\itap0 {\b fs flushvolume}{ <directory> :\tab
+flush cached data from volume.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-3240\li3240\ri0\widctlpar\jclisttab\tx360\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin3240\itap0 {\b pts.exe}{:\tab
+manage Protection Groups. See documentation for more information
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }{\b
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\page }{\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ IDH_SETTINGS}}}{\b\fs24 Settings}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par Within the Settings dialog you can choose to automatically con
+nect the AFS Client. When the AFS Control Panel first starts running it checks this option; if selected, then the AFS Control Panel will automatically connect to the AFS file system and connect your checked Drive Letter Map Points.
+\par
+\par Hint: you could configure the AFS Control Panel to run when Windows first starts up. With the }{\i automatic connect}{ option, each time windows is started your AFS drives would be available, just like a local drive.
+\par
+\par The following options are available:
+\par
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0 {\b\i Log To File}{ \endash AFS Contro
+l Panel activity is recorded on a disk file (AFSCLI.LOG) in the AFS Control Panel directory (default C:\\AFSCLI\\). This file is useful when reporting bugs to the AFS support team. (NOTE: by toggling this option OFF then }{\b\i <Accept>}{ and ON then }{
+\b\i <Accept>}{), the client will clear its disk based log file. If the option doesn\rquote t change (left ON or Off) choosing }{\b\i <Accept>}{ will not affect the log file.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b\i Log To Window}{ \endash AFS Control Panel activity is displayed in a log window.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b\i Connect on Start}{ \endash Automatically connects to the AFS file system when the client is started.
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par Different usernames and passwords can be used during }{\b\i Connect on Start}{. See }{\uldb Miscellaneous}{\v Miscellaneous}{ for command line options.
+\par
+\par
+\par }\pard \qc \li360\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\page }{\cs17\super ${\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super $}{ Trouble Shooting?}}#{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ TroubleShooting}}}{\b Trouble Shooting?}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\b
+\par }{Guidelines for contacting the Open Afs team:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0 {
+Where in the process did the error occur: connection, disconnection, file access, program initialization, or a particular operation sequence?
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}How did the AFS Control Panel respond?
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Send the activity log file, AFSCLI.LOG. (See }{\uldb Settings}{\v IDH_SETTINGS}{ to activate the log.)
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Can the problem be reproduced?
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Computer and server configuration.
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par HINT, during Connection the progress bar goes through 3 stages:
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 1.\tab}}\pard \ql \fi-360\li1440\ri0\widctlpar\jclisttab\tx1440\aspalpha\aspnum\faauto\ls12\ilvl1\adjustright\rin0\lin1440\itap0 {Enable AFS Client Console
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 2.\tab}Authentication
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 3.\tab}Connect Drive Letter Map Points
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard\plain \s4\qc \li0\ri5580\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel3\adjustright\rin5580\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {AFS Control Panel Progress
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\{bml progress.mrb\}
+\par }\pard \ql \li0\ri5580\widctlpar\aspalpha\aspnum\faauto\adjustright\rin5580\lin0\itap0 {
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+Under certain unfavorable conditions the connection process will time out during one of these cycles. When that happens you will get a message dialog box identifying the problem. The
+exact wording from the message box is important and should be recorded when contacting your AFS support team.
+\par
+\par See }{\uldb Contact Information}{\v ContactInfo}{ for email addresses.
+\par
+\par }{\b Useful hints:
+\par
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 1.\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls15\adjustright\rin0\lin720\itap0 {Connect to the Internet or your company's intranet. (Note: If you are
+ using the AFS Control Panel in a fire walled intranet environment with private AFS cells, you will probably need a CellServDB file specific to your company's environment. Ask your system administrator.)
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 2.\tab}Check your system time, timezone, and date settings and make sure they are synchronized with the AFS server.
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 3.\tab}Start the AFS Control Panel by double-clicking on the icon on the desktop or Start Menu.
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 4.\tab}A box will appear asking for your }{\i userid}{ and password. Type them in and press }{\b\i <Connect>}{
+. This will authenticate you to the AFS cell you specified at installation. (Note: You cannot use the GUI interface to authenticate to other cells at present. Th
+is will be added later. You can still authenticate to other cells using the "klog" command; see }{\uldb Miscellaneous}{.) Use the }{\b\i Save Password}{
+ checkbox to enable the AFS Control Panel to save your password (encrypted) in the registry for use next time you run the AFS Control Panel.
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 5.\tab}Now a Windows Explorer will start to allow you to browse Z: drives. Z: will be the root of the AFS tree.
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 6.\tab}By checking }{\b\i Advanced Options}{, you can add and change your drive letter assignments. There is one share assigned by default,
+ named "all". (Note: the "all" share cannot be removed.) New shares must be assigned a unique share name and an AFS path. You can connect or disconnect your AFS drives by checking or unchecking the box next to each drive letter. You can also set wheth
+er a drive will be automatically connected at startup (}{\b\fs28 *}{).
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 7.\tab}You can minimize the AFS Control Panel dialog window. Double click the icon in the system tray or right click to view the properties menu.
+\par {\listtext\pard\plain\f1\fs20 \hich\af1\dbch\af0\loch\f1 8.\tab}When you are ready to shut down the AFS Control Panel, bring up the AFS Control Panel dialog and click the }{\b\i <Disconnect>}{
+ button. This will terminate the AFS Control Panel service. Then click }{\b\i <Exit>}{ to quit.
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\page }{\cs17\super ${\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super $}{ Contact Information.}}#{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ ContactInfo}}}{\b Contact Information}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par This client was developed within the context of providing a large-scale Internet storage service. We welcome comments, questions, and bug reports from users of this program. Please contact the Open Source Development Site at
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\uldb http://www.openafs.org}{\v !ExecFile( http://www.openafs.org/)}{:
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }{\uldb MailTo: openafs-devel@openafs.org}{\v !ExecFile(mailto:}{\v\cf1 openafs-devel@openafs.org}{\v )}{
+\par
+\par Additional documentation is available at the following URL: }{\uldb http://www.transarc.com/Library/documentation/afs/3.5/windows}{\v !ExecFile(http://www.transarc.com/Library/documentation/afs/3.5/windows/index.htm)}{\uldb
+\par }{\f0
+\par }{The help file contains information from various sources, including }{\ul TRANSARC AFS User\rquote s Guide}{.
+\par
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Legalities
+\par }\pard\plain \ql \li720\ri720\widctlpar\aspalpha\aspnum\faauto\adjustright\rin720\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\i }{\i
+Copyright 2000, International Business Machines Corporation and others. All Rights Reserved. This software has been released under the terms of the IBM Public \tab
+License. For details, see the LICENSE file in the top-level source directory or online at http://www.openafs.org/dl/license10.html
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\b\fs24
+\par }{\page }{\cs17\super +{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super +}{ PROP:0}}}{\cs17\f0\uldb #{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ Properties}}}{\b AFS File Properties}{
+\par
+\par Addition information about AFS cells can be viewed by using the properties menu associated with any AFS file or AFS volume (assigned drive letter).
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Once AFS file system is connected, from the Explorer, right click an AFS file or AFS assigned drive letter
+. You will see the }{\b\i AFS}{ option added to the properties dialog box. These options include: setting new connection points, changing file access rights and other administrative activities.
+\par
+\par }\pard\plain \s4\qc \li0\ri5580\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel3\adjustright\rin5580\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {File Properties
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\{bml proper.mrb\}
+\par
+\par
+\par
+\par }{\f0\uldb Access Control Lists\'85}{\v\f0 SET_AFS_ACL_ENTRY_HELP_ID}{
+\par }{\f0\uldb Volume/Partition}{\v\f0 VOLUME_INFO_HELP_ID}{
+\par }{\f0\uldb Mount Point}{\v\f0\fs24 MountPoints}{
+\par }{\f0\uldb Flush File/Dir}{\v\f0 FlushFileDir}{
+\par }{\f0\uldb Flush Volume}{\v\f0 FlushVolume}{
+\par }{\f0\uldb Show File Servers}{\v\f0 SHOW_FILE_SERVERS_HELP_ID}{
+\par }{\f0\uldb Show Cell}{\v\f0 SHOW_CELL_HELP_ID}{
+\par }{\f0\uldb Show Server Status}{\v\f0 SERVER_STATUS_HELP_ID}{
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\page }{\cs17\super +{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super +}{ PROP:1}}#{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\cs17\super #}{ SET_AFS_ACL_ENTRY_HELP_ID}}}{\b\fs24 Access Control Lists\'85}{\b
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par AFS implements per-directory Access Control Lists (ACL). These improve the ability to specify which set of users has access to the files within the directory, and operations they may perform. ACL\rquote s are us
+ed in addition to the standard UNIX mode bits. There are seven expressible rights, as listed below:
+\par
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s16\ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0 {\b Read (r)}{:\tab
+The ability to read the contents of the files in a directory.}{\b
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Lookup (l):}{\tab The ability to look up names in a directory.}{\b
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Write (w):\tab }{The ability to create new files and overwrite the content of existing files in a directory.}{\b
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Insert (i):}{\tab The ability to insert new files in a directory, but not overwrite existing files.}{\b
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Delete (d):}{\tab The ability to delete files in a directory.}{\b
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Lock (k):}{\tab The ability to acquire and release advisory locks on a given directory.}{\b
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Administer (a):}{\tab The Ability to change a directory\rquote
+s ACL. Hint: this not the same as Administrative privileges (e.g. Administrative privileges are required to change cell quotas).}{\b
+\par }\pard \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\b
+\par }{From this dialog box you can do the following:}{\f0\fs24
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s16\ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin720\itap0 {Add \endash See }{\uldb Add Access Control Information}{\v
+ADD_ACL_ENTRY_HELP_ID}{
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Remove - Remove entry for the ACL list
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Clean \endash Clean obsolete entries from the ACL list.
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Copy - See }{\uldb Copy Access Control List}{\v COPY_ACL_HELP_ID}{
+\par }\pard \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par AFS defines three special system groups that you can put on your access control lists:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls22\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+system:anyuser: Any individual who accesses AFS files.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}system:authuser: Any individual in possession of a valid Kerberos ticket (has authorization).
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \s16\ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls19\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+system:administrators \endash group includes those in your cell authorized to operate and administer AFS.
+\par }\pard\plain \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }{\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ ADD_ACL_ENTRY_HELP_ID}}}{\b\fs24 Add Access Control Information
+
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\fs24
+\par }{From this dialog box you can add new Access Control Information to a directory. You must have ACL privileges to change ACL information. There are two types:
+\par
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \s16\ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls18\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+Normal Entry:\tab Adding a control list. E.g. option }{\b r}{ gives the permission to read.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls18\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+Negative Entry: Remove a particular right. E.g. option }{\b r}{
+ would remove permission to read from a group that has permission to read. (Hint: There are two ways to restrict access, remove them from the Normal Entry or to include them in the Negative Entry.)
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard\plain \s2\ql \li0\ri0\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {Using Protection Groups
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par An access control list group is a defined as a list of individual users that you can place in the access control lists (ACLs\rquote ) of your directories. ACLs\rquote
+ grant the same access rights to a number of people all at once, making user maintenance much easier. Instead of adding (and removing) individuals separately, users can be added and removed from ACLs\rquote
+, updating all the directories at once. When you create a group you automatically become its owner. A group\rquote s owner is the only one allowed to administer the group: add or remove members, rename it, change its owner, or delete it.
+\par
+\par Groups can only be created, deleted, or changed using the command line options. See }{\uldb Command Line Tools}{\v CommandLineTools}{
+\par
+\par The name field is used to denote properties to a specific group or user name. E.g. erz may create a group erz:friends.
+\par
+\par There 3 special, built-in groups, as described below:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls22\adjustright\rin0\lin720\itap0 {system:anyuser: Any individual who accesses AFS files.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}system:authuser: Any individual in possession of a valid Kerberos ticket (has authorization).
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}system:administrators \endash group includes those in your cell authorized to operate and administer AFS.
+\par }\pard \ql \li360\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\cs17\super #}{ COPY_ACL_HELP_ID}}}{\b\fs24 Copy Access Control List
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par You can copy an ACL from a directory or volume to another directory or volume.
+\par
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls20\adjustright\rin0\lin720\itap0 {Highlight th
+e source AFS directory. The source will provide the ACL you wish to copy.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Bring up the Properties menu by right clicking and selecting AFS option.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Select Action Control Lists\'85
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Highlight the ACL item you wish to copy
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Select }{\b\i <Copy>}{ button.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Enter in the destination AFS directory.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Select }{\b\i <OK>}{\b .}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {Hint: If open up the AFS properties of the destination volume or subdirectory, you will find the results of your copy. \page }{\cs17\super +{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super +}{ PROP:2}}}{\cs17 #{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17 #}{ VOLUME_INFO_HELP_ID}}}{\cs17\super #{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ PARTITION_INFO_HELP_ID}}}{\b\fs24 Volume/Partition}{
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par AFS divides disks partitions into subsections called volumes. A volume houses a sub-tree of related files and directories. Most AFS cells use one volume for each user\rquote s home directory \endash all files and subdirectories in a user\rquote
+s home directory are typically stored together on one file server machine, in one volume on one of the server\rquote s disk partitions.
+\par
+\par You do not have to know which file server machine houses your volume, because AFS finds yours files for you automatically.
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par You have two menu options:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\i <P
+roperties>}{ \endash View Volume Information. File directory drive letter, user name, ID number, Quota size, Bytes used, % Used. You may also set new Quotas and view Partition Information.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b\i <Refresh name/ID map>}{ - validate volume ID and name mappings.
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par Volumes have a size limit, or quota, assigned by the system administrator. A volume\rquote s quota, measured in 1 kilobyte units, determines the storage space allowed in the volume.
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard\plain \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ MOUNT_POINTS_HELP_ID}}#{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ REMOVE_MOUNT_POINTS_HELP_ID}}#{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ MAKE_MOUNT_POINT_HELP_ID}}}{\cs17 #{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\fs24 #}{\fs24 }{MountPoints}}}{\b\fs24 Mount Point}{\fs24
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\fs24
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+Mount Points can be assigned as sub-directories inside your AFS directory. They are assigned to volumes in your own cell or different cell.
+\par
+\par Using the AFS Control Panel (See }{\uldb Advanced Options}{\v AdvancedOptions}{) to define a map point is different than using AFS file properties menu with Window\rquote
+s Explorer. AFS Control Panel can connect a Drive Letter Map Point to a drive letter; whereas, using the AFS file properties menu with Window\rquote s Explorer to specify a Mount Point that will make an
+AFS volume appear as a sub-directory within your AFS directory.
+\par
+\par You may choose one of the following operations:
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s16\ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls5\adjustright\rin0\lin720\itap0 {\b\i <Show>}{\b :}{ View File, Volume, Cell and Type
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b\i <Remove>}{: Remove Mount Point from the list
+\par {\listtext\pard\plain\s16 \f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\b\i <Make>}{: Make a new Mount Point
+\par }\pard\plain \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {There are three fields for each Mount Point:
+\par
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls16\adjustright\rin0\lin720\itap0 {Directory \endash
+ Directory location where the AFS volume is to appear as a sub-directory
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Volume \endash a sub-tree of related files and directories
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Cell \endash An AFS administrative domain.
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Options
+\par {\listtext\pard\plain\f2\fs20 \hich\af2\dbch\af0\loch\f2 o\tab}}\pard \ql \fi-360\li1440\ri0\widctlpar\jclisttab\tx1440\aspalpha\aspnum\faauto\ls16\ilvl1\adjustright\rin0\lin1440\itap0 {Regular \endash default privileges
+\par {\listtext\pard\plain\f2\fs20 \hich\af2\dbch\af0\loch\f2 o\tab}Read/Write \endash Read & Write privileges only
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\b\fs24
+\par }{For example:
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls17\adjustright\rin0\lin720\itap0 {Directory: u:\\YourFolder
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Volume: user:yourname
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Cell: youdomain.com
+\par }\pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
+\par
+\par }\pard\plain \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ FlushVolume}}#{\footnote \pard\plain
+\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ }{\fs24 FlushFileDir}}}{\b\fs24 Flush Volume File/Dir
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\b\fs24
+\par }{As a user, you work on an AFS Control Panel machine. A process called a Cache Manager on that machine is your \'93agent\'94
+ in accessing information stored in the AFS file space. When you access a file, the Cache Manager on your client machine requests the file from the file server machines. The Cache Manager stores a copy of the requested file on your client workstation
+\rquote s local disk.
+\par
+\par Selecting to }{\b\i <Flush}{\b File/Dir}{\b\i >}{ will send file changes to the file server and clear out its cache. It is not necessary to do this operation as the file system does it automatically, including during the shut down process.
+\par
+\par Selecting to }{\b <Flush Volume>}{ will send all changes to all files and flush the complete volume.
+\par
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\cs17\super #}{ }{\fs24 SHOW_FILE_SERVERS_HELP_ID}}}{\b\fs24 Show File Servers
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par The AFS file space is not necessarily stored on the same machine \endash directory trees are stored in volumes that can be stored on different machines.
+\par
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\cs17\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\cs17\super #}{ }{\uldb SHOW_CELL_HEL}{\v P_ID}}}{\b\fs24 Show Cell
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par A cell in the AFS file space acts as an administrative domain. A cell\rquote s domain can consist of a company, a university department, or any defined group of users.
+\par
+\par The AFS file space is not necessarily stored on the same machine \endash directory trees are stored in volumes that can be stored on different machines.
+\par
+\par This option will show which cell is assigned to a mapping point.
+\par
+\par }\pard \qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\cs17\b\fs24\super #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ SERVER_STATUS_HELP_ID}}}{\b\fs24 Show Server Status
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par Sometimes one or more file server machines in your cell will become unavailable due to problems or maintenance. In these case, you will be unable to access files stored on those machines until the machines come back into service.
+As mentioned before, your Cache Manager may have copies of your files store locally that you can still work on.
+\par
+\par This options allows you to check the status of the following:
+\par
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls21\adjustright\rin0\lin720\itap0 {Local Cell
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Specific Cell \endash enter the name of a specific cell
+\par {\listtext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}All Cells
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {
+\par }}
\ No newline at end of file
--- /dev/null
+// MyFrame.cpp : implementation file
+// frame class used to demonstrate UI-threads
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#include "stdafx.h"
+#include "MyFrame.h"
+#include "ProgBarDlg.h"
+#include "share.h"
+#include "datalog.h"
+#include "WinAfsLoad.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+// CMyThread Stuff //
+
+HANDLE CMyUIThread::m_hEventThreadKilled=NULL;
+
+IMPLEMENT_DYNCREATE(CMyUIThread, CWinThread)
+
+CMyUIThread::CMyUIThread()
+{
+ m_pLog=NULL;
+}
+
+CMyUIThread::~CMyUIThread()
+{
+}
+
+void CMyUIThread::operator delete(void* p)
+{
+ // The exiting main application thread waits for this event before completely
+ // terminating in order to avoid a false memory leak detection. See also
+ // CMyUIThread::OnNcDestroy in bounce.cpp.
+
+ SetEvent(m_hEventThreadKilled);
+ CWinThread::operator delete(p);
+}
+
+BOOL CMyUIThread::InitInstance()
+{
+#ifdef _AFXDLL
+// Enable3dControls(); // Call this when using MFC in a shared DLL
+#else
+// Enable3dControlsStatic(); // Call this when linking to MFC statically
+#endif
+ // we use the modeless dialog box so we can create it invisable
+
+ m_pMainWnd = new CProgBarDlg; //we use the window pointer so MFC will delete the thread when Main window is destroyed
+
+ if (m_pMainWnd==NULL)
+ {
+ AfxMessageBox("AFS - Memory allocation error",MB_OK);
+ return FALSE;
+ }
+ if (!((CProgBarDlg *)m_pMainWnd)->Create())
+ {
+ AfxMessageBox("AFS - Thread Memory allocation error",MB_OK);
+ return FALSE;
+ }
+ // Initialize sockets
+ CString msg;
+ if (!((CProgBarDlg *)m_pMainWnd)->Connect(msg))
+ {
+ AfxMessageBox(msg,MB_OK);
+ return FALSE;
+ }
+ m_pLog = new CDatalog();
+ if (m_pLog->Create() != TRUE)
+ {
+ delete m_pLog;
+ m_pLog=NULL;
+ }
+ return TRUE;
+}
+
+int CMyUIThread::ExitInstance()
+{
+ // TODO: perform any per-thread cleanup here
+ if (m_cPrint.m_hFile!=CFile::hFileNull)
+ m_cPrint.Close();
+ return CWinThread::ExitInstance();
+}
+
+BEGIN_MESSAGE_MAP(CMyUIThread, CWinThread)
+ //{{AFX_MSG_MAP(CMyUIThread)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ //}}AFX_MSG_MAP
+ ON_THREAD_MESSAGE(WM_UIONPARM,OnParm)
+ ON_THREAD_MESSAGE(WM_UICONNECT,OnConnect)
+ ON_THREAD_MESSAGE(WM_LOG,OnLog)
+END_MESSAGE_MAP()
+
+
+void CMyUIThread::OnParm( UINT wp, LONG lp)
+{
+ switch (wp)
+ {
+ case ONPARMCLOSE:
+ m_pMainWnd->DestroyWindow(); // this will also destroy the datalog window
+ m_pLog=NULL;
+ if (m_cPrint.m_hFile!=CFile::hFileNull)
+ m_cPrint.Close();
+ break;
+ case ONPARMDISCONNECT:
+ ((CProgBarDlg *)m_pMainWnd)->DisConnect();
+ CWINAFSLOADAPP->WSANotifyFromUI(AFS_EXITCODE_NORMAL,NULL);
+ break;
+ default:
+ ASSERT(0);
+ break;
+ }
+
+}
+
+// these routines must either return null or point to a message
+void CMyUIThread::OnConnect( UINT wParam, LONG lp)
+{
+ CString sStatus;
+ if (((CProgBarDlg *)m_pMainWnd)->Connect(sStatus))
+ {
+ CWINAFSLOADAPP->NotifyFromUI(wParam,NULL);
+ return;
+ }
+ CWINAFSLOADAPP->NotifyFromUI(wParam,sStatus);
+}
+
+void CMyUIThread::OnLog( UINT wp, LONG lp)
+{
+TRY
+{
+ switch (wp)
+ {
+ case 0:
+ if ((lp) && (m_cPrint.m_hFile!=CFile::hFileNull))
+ {
+ CString *pMsg=(CString *)lp;
+ m_cPrint.Write((const char *)*pMsg, lstrlen((const char *)*pMsg));
+ m_cPrint.Flush();
+ }
+ if (m_pLog==NULL) break;
+ if (lp)
+ {
+ CString *pMsg=(CString *)lp;
+ m_pLog->m_sEdit+=*pMsg;
+ delete pMsg; //FREE up date
+ } else
+ m_pLog->m_sEdit="";
+ m_pLog->UpdateData(FALSE);
+ m_pLog->m_cEdit.LineScroll(10000);
+ if ( (m_pLog->GetStyle() & (WS_VISIBLE|WS_MINIMIZE))==WS_VISIBLE)
+ m_pLog->SendMessage(WM_PAINT);
+ break;
+ case LOGSHOWWINDOW:
+ if (m_pLog==NULL) break;
+ m_pLog->ShowWindow((lp)?SW_SHOWNORMAL:SW_HIDE);
+ break;
+ case LOGSHOWPRINT:
+ if (lp==NULL)
+ {
+ if (m_cPrint.m_hFile!=CFile::hFileNull)
+ m_cPrint.Close();
+ } else {
+ CString *mp=(CString *)lp;
+ if (m_cPrint.Open((const char *)*mp
+ ,CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite,&m_cPrintException)==NULL)
+ {
+ TCHAR szError[1024];
+ m_cPrintException.GetErrorMessage(szError, 1024);
+ LOG("Log file(%s) open error %s",(const char *)lp,szError);
+ break;
+ }
+ m_cPrint.SeekToEnd();
+ delete mp; //this was passed as a pointer to a created CString;
+ CString mt;
+ SYSTEMTIME timeDest;
+ GetSystemTime(&timeDest);
+ mt.Format("\nNew Session:(%02d:%02d:%2d-%03d)\n",
+ timeDest.wHour,
+ timeDest.wMinute,
+ timeDest.wSecond,
+ timeDest.wMilliseconds);
+ m_cPrint.Write((const char *)mt, lstrlen(mt));
+ }
+ break;
+ default:
+ break;
+ }
+}
+CATCH(CFileException, e)
+{
+ if (m_cPrint.m_hFile!=CFile::hFileNull)
+ m_cPrint.Close();
+ TCHAR szError[1024];
+ e->GetErrorMessage(szError, 1024);
+ LOG("Open Log file error %s",szError);
+}
+END_CATCH
+}
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// MyFrame.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyFrame frame
+#ifndef _MYFRAME_H_
+#define _MYFRAME_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+ #error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // main symbols
+#define LOGSHOWWINDOW 1
+#define LOGSHOWPRINT 2
+#define ONPARMCLOSE 0
+#define ONPARMDISCONNECT 1
+#define ONPARMCONNECT 2
+
+class CProgBarDlg;
+class CDatalog;
+
+///////////////////// CMyThread stuff //////////////////////////
+
+class CMyUIThread: public CWinThread {
+ DECLARE_DYNCREATE(CMyUIThread)
+ CMyUIThread(); // protected constructor used by dynamic creation
+protected:
+ CDatalog *m_pLog;
+ CFile m_cPrint;
+ CFileException m_cPrintException;
+// Attributes
+public:
+ static HANDLE m_hEventThreadKilled;
+
+ void operator delete(void* p);
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CMyUIThread)
+ public:
+ virtual BOOL InitInstance();
+ virtual int ExitInstance();
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ virtual ~CMyUIThread();
+
+ // Generated message map functions
+ //{{AFX_MSG(CMyUIThread)
+ // NOTE - the ClassWizard will add and remove member functions here.
+ //}}AFX_MSG
+ afx_msg void OnParm( UINT, LONG );
+ afx_msg void OnConnect( UINT, LONG );
+ afx_msg void OnLog( UINT, LONG );
+ DECLARE_MESSAGE_MAP()
+};
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+# Required Include paths
+#AFSDEV_BUILDTYPE=FREE
+#OUTDIR=.\Release
+#AFSD_INC_SDK9X = /I $(HOMEDRIVE)\tol\sdk95\Include
+#AFSD_INC_MFC9X = /I $(HOMEDRIVE)\PROGRA~1\MICROS~2\VC98\INCLUDE /I $(HOMEDRIVE)\PROGRA~1\MICROS~2\VC98\MFC\INCLUDE /I $(HOMEDRIVE)\PROGRA~1\MICROS~2\VC98\ATL\INCLUDE
+
+!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
+OUTDIR = $(DESTDIR)\WinInstall
+OUTDIRHLP = $(OUTDIR)
+
+!IF "$(AFSDEV_BUILDTYPE)" == ""
+AFSDEV_BUILDTYPE=FREE
+!MESSAGE No configuration specified. Defaulting to FREE.
+!ENDIF
+
+!IF "$(AFSDEV_BUILDTYPE)" != "FREE" && "$(AFSDEV_BUILDTYPE)" != "CHECKED"
+!MESSAGE Invalid configuration "$(AFSDEV_BUILDTYPE)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro AFSDEV_BUILDTYPE on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "WinAfsLoad.mak" AFSDEV_BUILDTYPE="FREE"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "FREE" (based on "Win32 (x86) Application")
+!MESSAGE "CHECKED" (based on "Win32 (x86) Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OUTDIR)" == ""
+!MESSAGE You must specify OUTDIR to point to a local hardrive linkage area
+!MESSAGE Microsoft Link may not complete correctly over AFS drives
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+HLPDIR= .\HELP
+
+!IF "$(AFSDEV_BUILDTYPE)" == "FREE"
+
+INTDIR=.
+HLP=hcrtf.exe
+HLP_PROJ = /x
+# Begin Custom Macros
+# End Custom Macros
+
+INSTALL : prep "$(OUTDIR)\WinAfsLoad.exe" "$(OUTDIRHLP)\afswin9x.HLP" "$(OUTDIR)\afswin9x.CNT"
+
+CLEAN ::
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(HLPDIR)\afswin9x.hlp
+ -@erase "$(OUTDIRHLP)\afswin9x.hlp
+ -@erase "$(OUTDIRHLP)\afswin9x.cnt
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP_PROJ=/nologo /MD /W3 /GX /O2 \
+ $(CPP_INCLUDE) /P \
+ /I "$(DESTDIR)\include\\" /I "$(DESTDIR)\include\rx" /I "$(DESTDIR)\include\afs" \
+ /D "NDEBUG" /D "_MFC" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_WINNT" /D "_AFXDLL" /D "ENCRIPT" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\WinAfsLoad.res" $(AFSD_INC_MFC) /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\WinAfsLoad.bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=mpr.lib afsauth.lib afskauth.lib afsprot.lib afspioctl.lib afsaudit.lib afsutil.lib afscom_err.lib afsreg.lib afscmd.lib afsubik.lib afsrxkad.lib afsdes.lib afsrx.lib afslwp.lib libosi.lib libafsconf.lib Svrapi.lib /nologo /subsystem:windows /machine:I386 /out:"$(OUTDIR)\WinAfsLoad.exe" /libpath:"$(DESTDIR)\lib\afs" /libpath:"$(DESTDIR)\lib"
+LINK32_OBJS= \
+ "$(INTDIR)\api95.obj" \
+ "$(INTDIR)\CAfs.obj" \
+ "$(INTDIR)\Encript.obj" \
+ "$(INTDIR)\Change.obj" \
+ "$(INTDIR)\CommandSettings.obj" \
+ "$(INTDIR)\CRegkey.obj" \
+ "$(INTDIR)\Datalog.obj" \
+ "$(INTDIR)\Force.obj" \
+ "$(INTDIR)\modver.obj" \
+ "$(INTDIR)\MyFrame.obj" \
+ "$(INTDIR)\ProgBarDlg.obj" \
+ "$(INTDIR)\Retry.obj" \
+ "$(INTDIR)\Settings.obj" \
+ "$(INTDIR)\TermWarn.obj" \
+ "$(INTDIR)\Transbmp.obj" \
+ "$(INTDIR)\TrayIcon.obj" \
+ "$(INTDIR)\Wait.obj" \
+ "$(INTDIR)\WinAfsLoad.obj" \
+ "$(INTDIR)\WinAfsLoadDlg.obj" \
+ "$(INTDIR)\WinAfsLoad.res"
+
+"$(OUTDIR)\WinAfsLoad.exe" : "$(INTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) \
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+
+!ELSEIF "$(AFSDEV_BUILDTYPE)" == "CHECKED"
+
+INTDIR=.
+HLP=hcrtf.exe
+HLP_PROJ = /x
+# Begin Custom Macros
+# End Custom Macros
+
+INSTALL : prep "$(OUTDIR)\WinAfsLoad.exe" "$(OUTDIRHLP)\afswin9x.HLP" "$(OUTDIR)\afswin9x.CNT"
+
+CLEAN ::
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(INTDIR)\WinAfsLoad.res"
+ -@erase "$(OUTDIR)\WinAfsLoad.pdb"
+ -@erase "$(HLPDIR)\afswin9x.hlp
+ -@erase "$(OUTDIRHLP)\afswin9x.hlp
+ -@erase "$(OUTDIRHLP)\afswin9x.cnt
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od \
+ $(CPP_INCLUDE) \
+ /I "$(DESTDIR)\include\\" /I "$(DESTDIR)\include\rx" /I "$(DESTDIR)\include\afs" \
+ /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /D _WIN32_IE=0x0400 /D "TESTBUTTONS" /D "_MFC" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_WINNT" /D "_AFXDLL" /D "ENCRIPT" /D "NOKNOK" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
+
+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\WinAfsLoad.res" $(AFSD_INC_MFC) /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(INTDIR)\WinAfsLoad.bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=Svrapi.lib Ws2_32.lib mpr.lib afsauth.lib afskauth.lib afsprot.lib afspioctl.lib afsaudit.lib afsutil.lib afscom_err.lib afsreg.lib afscmd.lib afsubik.lib afsrxkad.lib afsdes.lib afsrx.lib afslwp.lib libosi.lib libafsconf.lib /nologo /subsystem:windows /pdb:"$(OUTDIR)\WinAfsLoad.pdb" /debug /machine:I386 /out:"$(OUTDIR)\WinAfsLoad.exe" /pdbtype:sept /libpath:"$(DESTDIR)\lib\afs" /libpath:"$(DESTDIR)\lib"
+LINK32_OBJS= \
+ "$(INTDIR)\api95.obj" \
+ "$(INTDIR)\CAfs.obj" \
+ "$(INTDIR)\Encript.obj" \
+ "$(INTDIR)\Change.obj" \
+ "$(INTDIR)\CommandSettings.obj" \
+ "$(INTDIR)\CRegkey.obj" \
+ "$(INTDIR)\Datalog.obj" \
+ "$(INTDIR)\Force.obj" \
+ "$(INTDIR)\modver.obj" \
+ "$(INTDIR)\MyFrame.obj" \
+ "$(INTDIR)\ProgBarDlg.obj" \
+ "$(INTDIR)\Retry.obj" \
+ "$(INTDIR)\Settings.obj" \
+ "$(INTDIR)\TermWarn.obj" \
+ "$(INTDIR)\Transbmp.obj" \
+ "$(INTDIR)\TrayIcon.obj" \
+ "$(INTDIR)\Wait.obj" \
+ "$(INTDIR)\WinAfsLoad.obj" \
+ "$(INTDIR)\WinAfsLoadDlg.obj" \
+ "$(INTDIR)\WinAfsLoad.res"
+
+"$(OUTDIR)\WinAfsLoad.exe" : "$(INTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy to Debugger
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+# Begin Custom Macros
+# End Custom Macros
+
+$(DS_POSTBUILD_DEP) : "$(OUTDIR)\WinAfsLoad.exe"
+ echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("WinAfsLoad.dep")
+!INCLUDE "WinAfsLoad.dep"
+!ELSE
+!MESSAGE Warning: cannot find "WinAfsLoad.dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(AFSDEV_BUILDTYPE)" == "FREE" || "$(AFSDEV_BUILDTYPE)" == "CHECKED"
+SOURCE=.\api95.cpp
+
+"$(INTDIR)\api95.obj" : $(SOURCE)
+
+
+SOURCE=.\CAfs.cpp
+
+"$(INTDIR)\CAfs.obj" : $(SOURCE)
+
+SOURCE=.\Change.cpp
+
+"$(INTDIR)\Change.obj" : $(SOURCE)
+
+
+SOURCE=.\CommandSettings.cpp
+
+"$(INTDIR)\CommandSettings.obj" : $(SOURCE)
+
+
+SOURCE=.\CRegkey.cpp
+
+"$(INTDIR)\CRegkey.obj" : $(SOURCE)
+
+
+SOURCE=.\Datalog.cpp
+
+"$(INTDIR)\Datalog.obj" : $(SOURCE)
+
+
+SOURCE=.\Encript.cpp
+
+"$(INTDIR)\Encript.obj" : $(SOURCE)
+
+
+SOURCE=.\Force.cpp
+
+"$(INTDIR)\Force.obj" : $(SOURCE)
+
+
+SOURCE=.\modver.cpp
+
+"$(INTDIR)\modver.obj" : $(SOURCE)
+
+
+SOURCE=.\MyFrame.cpp
+
+"$(INTDIR)\MyFrame.obj" : $(SOURCE)
+
+
+SOURCE=.\ProgBarDlg.cpp
+
+"$(INTDIR)\ProgBarDlg.obj" : $(SOURCE)
+
+
+SOURCE=.\Retry.cpp
+
+"$(INTDIR)\Retry.obj" : $(SOURCE)
+
+
+SOURCE=.\Settings.cpp
+
+"$(INTDIR)\Settings.obj" : $(SOURCE)
+
+SOURCE=.\TermWarn.cpp
+
+"$(INTDIR)\TermWarn.obj" : $(SOURCE)
+
+
+SOURCE=.\Transbmp.cpp
+
+"$(INTDIR)\Transbmp.obj" : $(SOURCE)
+
+
+SOURCE=.\TrayIcon.cpp
+
+
+"$(INTDIR)\TrayIcon.obj" : $(SOURCE)
+
+SOURCE=.\Wait.cpp
+
+"$(INTDIR)\Wait.obj" : $(SOURCE)
+
+
+SOURCE=.\WinAfsLoad.cpp
+
+"$(INTDIR)\WinAfsLoad.obj" : $(SOURCE)
+
+
+SOURCE=.\WinAfsLoad.rc
+
+"$(INTDIR)\WinAfsLoad.res" : $(SOURCE)
+ $(RSC) $(RSC_PROJ) $(SOURCE)
+
+
+SOURCE=.\WinAfsLoadDlg.cpp
+
+"$(INTDIR)\WinAfsLoadDlg.obj" : $(SOURCE)
+
+"$(OUTDIR)\afswin9x.HLP" : "$(HLPDIR)\afswin9x.HPJ"
+
+"$(HLPDIR)\afswin9x.HLP" : "$(HLPDIR)\afswin9x.RTF"
+ $(HLP) $(HLP_PROJ) $(HLPDIR)\afswin9x.HPJ
+
+"$(OUTDIRHLP)\afswin9x.HLP" : $(HLPDIR)\afswin9x.HLP
+ COPY $(HLPDIR)\afswin9x.HLP $(OUTDIRHLP)\.
+
+"$(OUTDIRHLP)\afswin9x.CNT" : $(HLPDIR)\afswin9x.CNT
+ COPY $(HLPDIR)\afswin9x.CNT $(OUTDIRHLP)\.
+
+!ENDIF
+
+install9x: install
+
+.SILENT:
+prep :
+ if not exist $(MSSDK)\Include\$(NULL) $(DESTDIR)\bin\util_cr.exe ~ "MSSDK must point to SDK include headers "
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// ProgBarDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "MyFrame.h"
+#include "WinAfsLoad.h"
+#include "ProgBarDlg.h"
+#include "share.h"
+//#include <process.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CProgBarDlg dialog
+
+
+CProgBarDlg::CProgBarDlg(CWnd* pParent /*=NULL*/)
+ : CDialog(CProgBarDlg::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CProgBarDlg)
+ m_sAuthenicateTime = _T("");
+ m_sBackgroundTime = _T("");
+ m_sMountTime = _T("");
+ //}}AFX_DATA_INIT
+ m_pParent=pParent;
+}
+
+CProgBarDlg::~CProgBarDlg()
+{
+ // nitwit do not expect any local variables to hang around
+}
+
+void CProgBarDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CProgBarDlg)
+ DDX_Control(pDX, IDC_CHECKAUTHENICATION, m_cAuthenicate);
+ DDX_Control(pDX, IDC_CHECKMOUNT, m_cMount);
+ DDX_Control(pDX, IDC_CHECKBACKGROUND, m_cBackground);
+ DDX_Control(pDX, IDC_STATUSREGION, m_cStatusRegion);
+ DDX_Control(pDX, IDC_COMPLETE_MOUNT, m_cCompleteMount);
+ DDX_Control(pDX, IDC_COMPLETE_ENABLE, m_cCompleteEnable);
+ DDX_Control(pDX, IDC_COMPLETE_AUTH, m_cCompleteAuth);
+ DDX_Text(pDX, IDC_TIMEAUTHENICATION, m_sAuthenicateTime);
+ DDX_Text(pDX, IDC_TIMEBACKGROUND, m_sBackgroundTime);
+ DDX_Text(pDX, IDC_TIMEMOUNT, m_sMountTime);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CProgBarDlg, CDialog)
+ //{{AFX_MSG_MAP(CProgBarDlg)
+ ON_WM_QUERYDRAGICON()
+ ON_WM_TIMER()
+ ON_MESSAGE( WM_PROGRESSPARM,OnParm)
+ ON_WM_DESTROY()
+ ON_WM_PAINT()
+ //}}AFX_MSG_MAP
+ ON_MESSAGE(WSA_EVENT, OnWSAEvent)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CProgBarDlg message handlers
+
+BOOL CProgBarDlg::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // Set the icon for this dialog. The framework does this automatically
+ // when the application's main window is not a dialog
+ SetIcon(m_hIcon, TRUE); // Set big icon
+ SetIcon(m_hIcon, FALSE); // Set small icon
+
+ // TODO: Add extra initialization here
+
+ m_Option=0;
+ SetFocus();
+ m_uStatus=0;
+ m_Socket = INVALID_SOCKET;
+// m_sLog="";
+ m_cBackground.GetWindowText(m_sDefaultBackground.GetBuffer(32),31);
+ m_cAuthenicate.GetWindowText(m_sDefaultAuthenicate.GetBuffer(32),32);
+ m_cMount.GetWindowText(m_sDefaultMount.GetBuffer(32),32);
+ return TRUE; // return TRUE unless you set the focus to a control
+}
+
+// If you add a minimize button to your dialog, you will need the code below
+// to draw the icon. For MFC applications using the document/view model,
+// this is automatically done for you by the framework.
+
+
+HCURSOR CProgBarDlg::OnQueryDragIcon()
+{
+ return (HCURSOR) m_hIcon;
+}
+
+void CProgBarDlg::OnTimer(UINT nIDEvent)
+{
+ // TODO: Add your message handler code here and/or call default
+
+ CString msg;
+ m_iOrientation=++m_iOrientation % 2;
+ CRect s1;
+ m_cStatusRegion.GetWindowRect(&s1);
+ ScreenToClient(&s1);
+ InvalidateRect(&s1,TRUE);
+ switch (nIDEvent)
+ {
+ case WM_PROGRESSTIMER:
+ {
+ CTimeSpan elapsed=::CTime::GetCurrentTime()-m_StartTime;
+ switch (m_Current)
+ {
+ case 1:
+ m_sBackgroundTime.Format("%02d:%02d",elapsed.GetTotalMinutes()
+ ,elapsed.GetTotalSeconds()-60*elapsed.GetTotalMinutes());
+ UpdateData(FALSE);
+ break;
+ case 2:
+ m_sAuthenicateTime.Format("%02d:%02d",elapsed.GetTotalMinutes()
+ ,elapsed.GetTotalSeconds()-60*elapsed.GetTotalMinutes());
+ UpdateData(FALSE);
+ break;
+ case 4:
+ m_sMountTime.Format("%02d:%02d",elapsed.GetTotalMinutes()
+ ,elapsed.GetTotalSeconds()-60*elapsed.GetTotalMinutes());
+ UpdateData(FALSE);
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ CDialog::OnTimer(nIDEvent);
+}
+
+LRESULT CProgBarDlg::OnParm(WPARAM wp, LPARAM lp)
+{
+ switch (wp)
+ {
+ case ProgFSetTitle:
+ if (lp==0) break;
+ {
+ char *msg=(char *)lp;
+ if (strlen(msg))
+ m_cBackground.SetWindowText(msg);
+ msg+=strlen(msg)+1;
+ if (strlen(msg))
+ m_cAuthenicate.SetWindowText(msg);
+ msg+=strlen(msg)+1;
+ if (strlen(msg))
+ m_cMount.SetWindowText(msg);
+ free((char *)lp);
+ }
+ break;
+ case ProgFShow:
+ ShowWindow(SW_SHOW);
+ m_nTimer=SetTimer(WM_PROGRESSTIMER,1000,0);
+ break;
+ case ProgFHide:
+ ShowWindow(SW_HIDE);
+ KillTimer(m_nTimer);
+ m_cBackground.SetWindowText(m_sDefaultBackground);
+ m_cAuthenicate.SetWindowText(m_sDefaultAuthenicate);
+ m_cMount.SetWindowText(m_sDefaultMount);
+ break;
+ case ProgFOpt:
+ ShowWindow(SW_SHOW);
+ m_Option=(UINT) lp;
+ m_sBackgroundTime="";
+ m_sAuthenicateTime="";
+ m_sMountTime="";
+ UpdateData(FALSE);
+ m_iOrientation=0;
+ if (m_Option & 1)
+ {
+ m_cBackground.ModifyStyle(WS_DISABLED,0,0);
+ } else {
+ m_cBackground.ModifyStyle(0,WS_DISABLED,0);
+ }
+ if (m_Option & 2)
+ m_cAuthenicate.ModifyStyle(WS_DISABLED,0,0);
+ else
+ m_cAuthenicate.ModifyStyle(0,WS_DISABLED,0);
+ if (m_Option & 4)
+ m_cMount.ModifyStyle(WS_DISABLED,0,0);
+ else
+ m_cMount.ModifyStyle(0,WS_DISABLED,0);
+ m_Current=0;
+ m_nTimer=SetTimer(WM_PROGRESSTIMER,1000,0);
+ ShowWindow(SW_SHOW);
+ break;
+ case ProgFNext:
+ m_iOrientation=0;
+ switch(m_Current)
+ {
+ case 0:
+ m_Current=1;
+ if (m_Option & m_Current)
+ {
+ CWnd* pWnd=GetDlgItem(IDC_TIMEBACKGROUND);
+ if (pWnd)
+ pWnd->SetFocus();
+ m_StartTime=CTime::GetCurrentTime();
+ OnTimer(WM_PROGRESSTIMER);
+ break;
+ }
+ case 1:
+ m_Current=2;
+ if (m_Option & m_Current)
+ {
+ OnTimer(WM_PROGRESSTIMER);
+ CWnd* pWnd=GetDlgItem(IDC_TIMEAUTHENICATION);
+ if (pWnd)
+ pWnd->SetFocus();
+ m_StartTime=CTime::GetCurrentTime();
+ break;
+ }
+ case 2:
+ m_Current=4;
+ if (m_Option & m_Current)
+ {
+ OnTimer(WM_PROGRESSTIMER);
+ CWnd* pWnd=GetDlgItem(IDC_TIMEMOUNT);
+ if (pWnd)
+ pWnd->SetFocus();
+ m_StartTime=CTime::GetCurrentTime();
+ break;
+ }
+ default:
+ m_Current=0;
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ CRect s1;
+ m_cStatusRegion.GetWindowRect(&s1);
+ ScreenToClient(&s1);
+ InvalidateRect(&s1,TRUE);
+ return 0;
+}
+
+BOOL CProgBarDlg::Create()
+{
+ return CDialog::Create(IDD, m_pParent);
+}
+
+void CProgBarDlg::PostNcDestroy()
+{
+ // TODO: Add your specialized code here and/or call the base class
+ if (m_Socket != INVALID_SOCKET)
+ WSAAsyncSelect(m_Socket, m_hWnd, 0, 0); //cancel out messages
+ if (m_Socket != INVALID_SOCKET)
+ closesocket(m_Socket);
+ delete this;
+}
+
+void CProgBarDlg::OnDestroy()
+{
+ KillTimer(m_nTimer);
+ Sleep(50);
+ CDialog::OnDestroy();
+ // TODO: Add your message handler code here
+}
+
+VOID CProgBarDlg::DisConnect()
+{
+ if (m_Socket != INVALID_SOCKET)
+ {
+ shutdown(m_Socket,3);
+ char cBuffer[AFS_MAX_MSG_LEN];
+ DWORD uStatus=1;
+ int loop=SOCKETIO/250;
+ while ((uStatus !=SOCKET_ERROR)&&(uStatus!=0) &&(loop-- >0))
+ {
+ Sleep(250);
+ uStatus = recv(m_Socket, (char FAR *)&cBuffer, AFS_MAX_MSG_LEN, 0 );
+ }
+ closesocket(m_Socket);
+ m_Socket = INVALID_SOCKET;
+ }
+ WSAAsyncSelect(m_Socket, m_hWnd, 0, 0); //cancel out messages
+ LOG("Socket Disconnect");
+}
+
+typedef struct SoCkErR {
+ int soc_err;
+ LPSTR szSockErr;
+} SOC_ERR;
+
+SOC_ERR socket_error[] = {
+ { WSANOTINITIALISED , "A successful WSAStartup must occur before using this function."},
+ { WSAENETDOWN , "The Windows Sockets implementation has detected that the network "\
+ "subsystem has failed."},
+ { WSAENOTCONN , "The socket is not connected."},
+ { WSAEINTR , "The (blocking) call was canceled using WSACancelBlockingCall."},
+ { WSAEINPROGRESS , "A blocking Windows Sockets operation is in progress."},
+ { WSAENOTSOCK , "The descriptor is not a socket."},
+ { WSAEOPNOTSUPP , "MSG_OOB was specified, but the socket is not of type SOCK_STREAM."},
+ { WSAESHUTDOWN , "The socket has been shut down; it is not possible to recv on a socket "\
+ "after shutdown has been invoked with how set to 0 or 2."},
+ { WSAEWOULDBLOCK , "The socket is marked as nonblocking and the receive operation would block."},
+ { WSAEMSGSIZE , "The datagram was too large to fit into the specified buffer and was truncated."},
+ { WSAEINVAL , "The socket has not been bound with bind."},
+ { WSAECONNABORTED , "The virtual circuit was aborted due to timeout or other failure."},
+ { WSAECONNRESET , "The virtual circuit was reset by the remote side."},
+ { WSAEACCES , "The requested address is a broadcast address, but the appropriate flag was not set."},
+ { WSAEFAULT , "The buf argument is not in a valid part of the user address space."},
+ { WSAENETRESET , "The connection must be reset because the Windows Sockets implementation dropped it."},
+ { WSAENOBUFS , "The Windows Sockets implementation reports a buffer deadlock."},
+ { WSAENOTCONN , "The socket is not connected."},
+ { WSAEWOULDBLOCK , " The socket is marked as nonblocking and the requested operation would block."},
+ { -1 , "Unknown Socket Error"}
+};
+
+LPCSTR show_socket_error()
+{
+ INT soc_err=WSAGetLastError();
+ SOC_ERR *lperr = &socket_error[0];
+ while (1 && lperr->soc_err != -1)
+ {
+ if (lperr->soc_err == soc_err)
+ {
+ return lperr->szSockErr;
+ }
+ lperr++;
+ }
+ return "Unknown Socket Error";
+}
+
+
+BOOL CProgBarDlg::Connect(CString &sStatus)
+{
+ CHAR szBuff[80];
+ UINT dwSize = sizeof(szBuff);
+ SOCKADDR_IN socketAddress;
+ m_Socket = socket( AF_INET, SOCK_DGRAM, 0);
+ if (m_Socket == INVALID_SOCKET) {
+ sStatus="Socket() failed";
+ return FALSE;
+ }
+ if (gethostname(szBuff, dwSize)!=0)
+ {
+ sStatus.Format("Get Host Name - %s", show_socket_error());
+ return FALSE;
+ }
+ socketAddress.sin_family = AF_INET;
+ socketAddress.sin_addr.s_addr = INADDR_ANY;
+ socketAddress.sin_port = htons(AFS_MSG_PORT); /* Convert to network ordering */
+ if (bind(m_Socket, (struct sockaddr FAR *) &socketAddress, sizeof(socketAddress)) == SOCKET_ERROR) {
+ sStatus.Format("Bind :%s", show_socket_error());
+ return FALSE;
+ }
+ if ((m_uStatus = WSAAsyncSelect( m_Socket,GetSafeHwnd(), WSA_EVENT, FD_READ | FD_CLOSE )) > 0) {
+ WSAAsyncSelect( m_Socket, GetSafeHwnd(), 0, 0);
+ sStatus.Format("Get Host Name: ", show_socket_error());
+ return FALSE;
+ }
+ m_bReadyToSend=TRUE;
+ sStatus="Success Connect";
+ LOG("Socket Connect");
+ return TRUE;
+}
+
+LRESULT CProgBarDlg::OnWSAEvent(WPARAM wParam, LPARAM lParam)
+{
+ CString sLog;
+ if (WSAGETSELECTERROR( lParam ) != 0) {
+// m_sLog.Format("Read Failure status=%d\r\n", WSAGETSELECTERROR(lParam));
+ WSAAsyncSelect( m_Socket,GetSafeHwnd(), 0, 0);
+ m_uStatus=WSAGETSELECTERROR( lParam );
+ LOG("WSA Select error");
+ return 0;
+ }
+ switch (WSAGETSELECTEVENT(lParam))
+ {
+ case FD_READ:
+ wParam=Decode(wParam,sLog);
+ LOG("OnWSAEvent FD_READ(%d)",wParam);
+ CWINAFSLOADAPP->WSANotifyFromUI(wParam,(const char *)sLog);
+ break;
+ case FD_CLOSE:
+ LOG("OnWSAEvent FD_CLOSE(%d)",wParam);
+ break;
+ case FD_WRITE:
+ LOG("OnWSAEvent FD_WRITE(%d)",wParam);
+ break;
+ default:
+ LOG("OnWSAEvent Unknown Response");
+ break;
+ }
+ return 0;
+}
+
+// this routine will set the notfication return (wParam) for WinAfsLoadDlg to receive
+// if problem with decoding result return AFS_EXITCODE_GENERAL_FAILURE
+// Other returns are:
+// AFS_EXITCODE_NORMAL(0) ,AFS_EXITCODE_PANIC(2) ,AFS_EXITCODE_NETWORK_FAILURE(3)
+UINT CProgBarDlg::Decode(WPARAM wParam,CString &sLog)
+{
+ m_bReadyToSend=FALSE;
+ m_uStatus = recv((SOCKET)wParam, (char FAR *)&m_buffer, AFS_MAX_MSG_LEN, 0 );
+ if (m_uStatus==0){
+ sLog.Format("Receive Error: %s", show_socket_error());
+ return AFS_EXITCODE_GENERAL_FAILURE;
+ }
+ SOCKETTYPE *p=(SOCKETTYPE *)m_buffer;
+ switch (p->header.msgtype)
+ {
+ case AFS_MSG_STATUS_CHANGE:
+ {
+ _afsMsg_statChange *sp=(_afsMsg_statChange *)p;
+ switch (sp->exitCode)
+ {
+ case AFS_EXITCODE_NORMAL:
+ {
+ if ((m_uStatus = WSAAsyncSelect( m_Socket,GetSafeHwnd(),WSA_EVENT, FD_READ | FD_CLOSE )) > 0) {
+ WSAAsyncSelect( m_Socket, GetSafeHwnd(), 0, 0);
+ sLog.Format("WSAAsyncSelect: %s", show_socket_error());
+ return AFS_EXITCODE_GENERAL_FAILURE;
+ }
+ int len=sp->hdr.length-sizeof(*sp);
+ if (len>0)
+ {
+ char *x=new char[len+1];
+ strncpy(x,&(sp->message),len);
+ *(x+len)=0;
+ sLog.Format("AFSD operation normal Message#%s#",x);
+ delete x;
+ } else {
+ sLog="AFSD operation normal";
+ }
+ }
+ break;
+ case AFS_EXITCODE_PANIC:
+ sLog="AFS Client Console Panic Exit";
+ break;
+ case AFS_EXITCODE_NETWORK_FAILURE:
+ sLog="AFS Client Network Failure Exit";
+ break;
+ default:
+ sLog.Format("Receive Error: Messsage format(exit code)=%0x",p->change.exitCode);
+ p->change.exitCode=AFS_EXITCODE_GENERAL_FAILURE;
+ break;
+ }
+ return (p->change.exitCode);
+ }
+ case AFS_MSG_PRINT:
+ if ((m_uStatus = WSAAsyncSelect( m_Socket, GetSafeHwnd(),WSA_EVENT, FD_READ | FD_CLOSE )) > 0) {
+ WSAAsyncSelect( m_Socket, GetSafeHwnd(), 0, 0);
+ sLog.Format("WSAAsyncSelect: %s", show_socket_error());
+ return AFS_EXITCODE_GENERAL_FAILURE;
+ }
+ return AFS_EXITCODE_GENERAL_FAILURE;
+ default:
+ sLog.Format("Receive Error: Messsage format=%0x",p->header.msgtype);
+ return AFS_EXITCODE_GENERAL_FAILURE;
+ }
+}
+
+
+
+void CProgBarDlg::OnPaint()
+{
+ CPaintDC dc(this); // device context for painting
+
+ // TODO: Add your message handler code here
+ //m_iCurrent is the Current item (1,2,4)
+ //m_iOption is which are active
+
+ CBrush brBack,brGreen,brYellow;
+ brBack.CreateSolidBrush(GetSysColor(COLOR_MENU));
+ brGreen.CreateSolidBrush(RGB(0,255,0));
+ brYellow.CreateSolidBrush(RGB(255,255,0));
+ CRect shape;
+ switch (m_Current)
+ {
+ case 1: //progress
+ SetShape(shape,m_Current,m_iOrientation);
+ dc.SelectObject(&brYellow);
+ dc.Ellipse(shape);
+ SetShape(shape,m_Option & 2,0);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brBack);
+ dc.Ellipse(shape);
+ }
+ SetShape(shape,m_Option & 4,0);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brBack);
+ dc.Ellipse(shape);
+ }
+ break;
+ case 2:
+ SetShape(shape,m_Option & 1,0);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brGreen);
+ dc.Ellipse(shape);
+ }
+ SetShape(shape,m_Current,m_iOrientation);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brYellow);
+ dc.Ellipse(shape);
+ }
+ SetShape(shape,m_Option & 4,0);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brBack);
+ dc.Ellipse(shape);
+ }
+ break;
+ case 4:
+ SetShape(shape,m_Option & 1,0);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brGreen);
+ dc.Ellipse(shape);
+ }
+ SetShape(shape,m_Option & 2,0);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brGreen);
+ dc.Ellipse(shape);
+ }
+ SetShape(shape,m_Current,m_iOrientation);
+ if (shape.Width())
+ {
+ dc.SelectObject(&brYellow);
+ dc.Ellipse(shape);
+ }
+ break;
+ default:
+ break;
+ }
+ // Do not call CDialog::OnPaint() for painting messages
+}
+
+void CProgBarDlg::SetShape(CRect &shape,int option,int orientation)
+{
+ CRect s1,s2,rect;
+ switch(option)
+ {
+ case 1:
+ m_cCompleteEnable.GetWindowRect(&s1);
+ break;
+ case 2:
+ m_cCompleteAuth.GetWindowRect(&s1);
+ break;
+ case 4:
+ m_cCompleteMount.GetWindowRect(&s1);
+ break;
+ default:
+ s1=CRect(0,0,0,0);
+ break;
+ }
+ ScreenToClient(&s1);
+ int delta=(s1.Width()-s1.Height())/2;
+ s2.top=s1.top-delta;
+ s2.bottom=s1.bottom+delta;
+ s2.left=s1.left+delta;
+ s2.right=s1.right-delta;
+ rect.top=s2.top;
+ rect.bottom=s2.bottom;
+ rect.left=s1.left;
+ rect.right=s1.right;
+ switch (orientation)
+ {
+ case 1:
+ shape=s2;
+ break;
+ default:
+ shape=s1;
+ break;
+ }
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_PROGBARDLG_H__FD4CD3C1_0EBF_11D4_A374_00105A6BCA62__INCLUDED_)
+#define AFX_PROGBARDLG_H__FD4CD3C1_0EBF_11D4_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+#include "afsmsg95.h"
+
+#define MAX_PENDING_CONNECTS 4 /* The backlog allowed for listen() */
+
+union SOCKETTYPE {
+ afsMsg_hdr_t header;
+ afsMsg_statChange_t change;
+ afsMsg_print_t print;
+};
+
+// ProgBarDlg.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CProgBarDlg dialog
+
+class CProgBarDlg : public CDialog
+{
+// Construction
+public:
+ CProgBarDlg(CWnd* pParent = NULL); // standard constructor
+ ~CProgBarDlg();
+ BOOL Create();
+ BOOL Connect(CString &);
+ VOID DisConnect();
+// BOOL InitSocket(CString &);
+ UINT m_uEvent;
+// Dialog Data
+ //{{AFX_DATA(CProgBarDlg)
+ enum { IDD = IDD_PROGBAR_DIALOG };
+ CStatic m_cAuthenicate;
+ CStatic m_cMount;
+ CStatic m_cBackground;
+ CButton m_cStatusRegion;
+ CStatic m_cCompleteMount;
+ CStatic m_cCompleteEnable;
+ CStatic m_cCompleteAuth;
+ CString m_sAuthenicateTime;
+ CString m_sBackgroundTime;
+ CString m_sMountTime;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CProgBarDlg)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void PostNcDestroy();
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ HICON m_hIcon;
+ UINT m_nTimer;
+ INT m_Current;
+ UINT m_Option;
+ CTime m_StartTime;
+ CWnd * m_pParent;
+ CString m_sDefaultAuthenicate;
+ CString m_sDefaultMount;
+ CString m_sDefaultBackground;
+ // Generated message map functions
+ //{{AFX_MSG(CProgBarDlg)
+ virtual BOOL OnInitDialog();
+ afx_msg HCURSOR OnQueryDragIcon();
+ afx_msg void OnTimer(UINT nIDEvent);
+ afx_msg LRESULT OnParm(WPARAM, LPARAM);
+ afx_msg void OnDestroy();
+ afx_msg void OnPaint();
+ //}}AFX_MSG
+ afx_msg LRESULT OnWSAEvent(WPARAM wParam, LPARAM lParam);
+ DECLARE_MESSAGE_MAP()
+
+ SOCKET m_Socket;
+ BOOL m_bReadyToSend;
+ UINT m_uStatus;
+// CString m_sLog;
+ UINT Decode(WPARAM wParam,CString &);
+ char m_buffer[AFS_MAX_MSG_LEN+1];
+ INT m_iOrientation; //timer based orientation of timer progress object
+ void SetShape(CRect &,int,int); //set shape for progress bar
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_PROGBARDLG_H__FD4CD3C1_0EBF_11D4_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// Retry.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "winafsload.h"
+#include "Retry.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CRetry dialog
+
+
+CRetry::CRetry(BOOL force,CWnd* pParent /*=NULL*/)
+ : CDialog(CRetry::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CRetry)
+ m_sMsg = _T("");
+ //}}AFX_DATA_INIT
+ m_force=force;
+}
+
+
+void CRetry::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CRetry)
+ DDX_Control(pDX, IDC_STATICOPTIONS, m_cOptions);
+ DDX_Control(pDX, IDC_FORCE, m_cForce);
+ DDX_Text(pDX, IDC_STATICMSG, m_sMsg);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CRetry, CDialog)
+ //{{AFX_MSG_MAP(CRetry)
+ ON_BN_CLICKED(IDC_FORCE, OnForceDismont)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CRetry message handlers
+
+void CRetry::OnForceDismont()
+{
+ // TODO: Add your control notification handler code here
+ EndDialog(IDC_FORCE);
+}
+
+BOOL CRetry::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // TODO: Add extra initialization here
+
+ if (m_force)
+ {
+ m_cForce.ModifyStyle(WS_DISABLED,0,0);
+ m_cOptions.SetWindowText("You map shut down any applications that are using the drive letter and then press Retry. Or press Cancel to the bypass the disconnect.\nYou may over-ride the file protection (possible loss of 'opened' file data) and slect Force to disconnect.");
+ }else {
+ m_cForce.ModifyStyle(0,WS_DISABLED,0);
+ m_cOptions.SetWindowText("You may shut down any applications that are using the drive letter and then press Retry. Or press Cancel to the bypass the disconnect.\n('Force' is not premitted.)");
+ }
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_RETRY_H__E69A224D_0AE0_11D4_A374_00105A6BCA62__INCLUDED_)
+#define AFX_RETRY_H__E69A224D_0AE0_11D4_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// Retry.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CRetry dialog
+
+class CRetry : public CDialog
+{
+// Construction
+public:
+ CRetry(BOOL force,CWnd* pParent = NULL); // standard constructor
+
+// Dialog Data
+ //{{AFX_DATA(CRetry)
+ enum { IDD = IDD_DIALOGRETRY };
+ CStatic m_cOptions;
+ CButton m_cForce;
+ CString m_sMsg;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CRetry)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ BOOL m_force;
+
+ // Generated message map functions
+ //{{AFX_MSG(CRetry)
+ afx_msg void OnForceDismont();
+ virtual BOOL OnInitDialog();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_RETRY_H__E69A224D_0AE0_11D4_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// Settings.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "winafsload.h"
+#include "WinAfsLoadDlg.h"
+#include "Settings.h"
+#include "datalog.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CSettings dialog
+
+
+CSettings::CSettings(CWinAfsLoadDlg* pParent /*=NULL*/)
+ : CDialog(CSettings::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CSettings)
+ //}}AFX_DATA_INIT
+ m_pParent=pParent;
+
+}
+
+
+BEGIN_MESSAGE_MAP(CSettings, CDialog)
+ //{{AFX_MSG_MAP(CSettings)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CSettings message handlers
+
+
+BOOL CSettings::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+ //set check mark if background window is visable
+ // TODO: Add extra initialization here
+
+ EnableToolTips(TRUE);
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+void CSettings::OnOK()
+{
+ // TODO: Add extra validation here
+ CDialog::OnOK();
+}
+
+
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_SETTINGS_H__01979F21_0FB8_11D4_A374_00105A6BCA62__INCLUDED_)
+#define AFX_SETTINGS_H__01979F21_0FB8_11D4_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// Settings.h : header file
+//
+
+class CDatalog;
+class CWinAfsLoadDlg;
+
+/////////////////////////////////////////////////////////////////////////////
+// CSettings dialog
+
+class CSettings : public CDialog
+{
+// Construction
+public:
+ CSettings(CWinAfsLoadDlg* pParent); // standard constructor
+
+// Dialog Data
+ //{{AFX_DATA(CSettings)
+ enum { IDD = IDD_MENUSETTINGS };
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CSettings)
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ CWinAfsLoadDlg *m_pParent;
+ // Generated message map functions
+ //{{AFX_MSG(CSettings)
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_SETTINGS_H__01979F21_0FB8_11D4_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// stdafx.cpp : source file that includes just the standard includes
+// WinAfsLoad.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__75E145B7_F5C0_11D3_A374_00105A6BCA62__INCLUDED_)
+#define AFX_STDAFX_H__75E145B7_F5C0_11D3_A374_00105A6BCA62__INCLUDED_
+
+#ifdef _WIN32_WINDOWS
+#undef _WIN32_WINDOWS //required when you do a make because it includes win32.mak
+#endif
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h> // MFC core and standard components
+#include <afxext.h> // MFC extensions
+#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h> // MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+#include <afxtempl.h> // add this for templets CList
+#ifdef WINSOCK2
+#include "winsock2.h"
+#endif
+#include <afxsock.h> // MFC socket extensions
+#include "wait.h"
+
+#endif // !defined(AFX_STDAFX_H__75E145B7_F5C0_11D3_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// TermWarn.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "winafsload.h"
+#include "TermWarn.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CTermWarn dialog
+
+
+CTermWarn::CTermWarn(CWnd* pParent /*=NULL*/)
+ : CDialog(CTermWarn::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CTermWarn)
+ // NOTE: the ClassWizard will add member initialization here
+ //}}AFX_DATA_INIT
+}
+
+
+void CTermWarn::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CTermWarn)
+ // NOTE: the ClassWizard will add DDX and DDV calls here
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CTermWarn, CDialog)
+ //{{AFX_MSG_MAP(CTermWarn)
+ // NOTE: the ClassWizard will add message map macros here
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CTermWarn message handlers
+
+void CTermWarn::PostNcDestroy()
+{
+ // TODO: Add your specialized code here and/or call the base class
+ delete this;
+}
+
+BOOL CTermWarn::Create()
+{
+ return CDialog::Create(IDD, NULL);
+}
+
+void CTermWarn::OnCancel()
+{
+ DestroyWindow();
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_TERMWARN_H__EBCBE030_03C3_11D4_A374_00105A6BCA62__INCLUDED_)
+#define AFX_TERMWARN_H__EBCBE030_03C3_11D4_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// TermWarn.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CTermWarn dialog
+
+class CTermWarn : public CDialog
+{
+// Construction
+public:
+ CTermWarn(CWnd* pParent = NULL); // standard constructor
+ BOOL Create();
+ void OnCancel();
+
+// Dialog Data
+ //{{AFX_DATA(CTermWarn)
+ enum { IDD = IDD_DIALOGTERM };
+ // NOTE: the ClassWizard will add data members here
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CTermWarn)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void PostNcDestroy();
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+ // Generated message map functions
+ //{{AFX_MSG(CTermWarn)
+ // NOTE: the ClassWizard will add member functions here
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_TERMWARN_H__EBCBE030_03C3_11D4_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#include "stdafx.h"
+#include "transbmp.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char BASED_CODE THIS_FILE[] = __FILE__;
+#endif
+
+// Colors
+#define rgbWhite RGB(255,255,255)
+// Raster op codes
+#define DSa 0x008800C6L
+#define DSx 0x00660046L
+
+
+CTransBmp::CTransBmp()
+{
+ m_iWidth = 0;
+ m_iHeight = 0;
+ m_hbmMask = NULL;
+}
+
+CTransBmp::~CTransBmp()
+{
+}
+
+void CTransBmp::GetMetrics()
+{
+ // Get the width and height
+ BITMAP bm;
+ GetObject(sizeof(bm), &bm);
+ m_iWidth = bm.bmWidth;
+ m_iHeight = bm.bmHeight;
+}
+
+
+int CTransBmp::GetWidth()
+{
+ if ((m_iWidth == 0) || (m_iHeight == 0)){
+ GetMetrics();
+ }
+ return m_iWidth;
+}
+
+int CTransBmp::GetHeight()
+{
+ if ((m_iWidth == 0) || (m_iHeight == 0)){
+ GetMetrics();
+ }
+ return m_iHeight;
+}
+
+void CTransBmp::Draw(HDC hDC, int x, int y)
+{
+ ASSERT(hDC);
+ HDC hdcMem = ::CreateCompatibleDC(hDC);
+ HBITMAP hbmold =
+ (HBITMAP)::SelectObject(hdcMem,
+ (HBITMAP)(m_hObject));
+ // Blt the bits
+ ::BitBlt(hDC,
+ x, y,
+ GetWidth(), GetHeight(),
+ hdcMem,
+ 0, 0,
+ SRCCOPY);
+ ::SelectObject(hdcMem, hbmold);
+ ::DeleteDC(hdcMem);
+}
+
+void CTransBmp::Draw(CDC* pDC, int x, int y)
+{
+ ASSERT(pDC);
+ HDC hDC = pDC->GetSafeHdc();
+ Draw(hDC, x, y);
+}
+
+void CTransBmp::UpdateMask(CWnd *wnd,CRect &rect)
+{
+ if (m_hbmMask)
+ ::DeleteObject(m_hbmMask);
+ m_hbmMask=NULL;
+ wnd->InvalidateRect(rect,TRUE);
+}
+
+void CTransBmp::CreateMask(HDC hDC,CRect &rect,int xoff)
+{
+ if (m_hbmMask) {
+ ::DeleteObject(m_hbmMask);
+ }
+ // Create memory DCs to work with
+ HDC hdcMask = ::CreateCompatibleDC(hDC);
+ HDC hdcImage = ::CreateCompatibleDC(hDC);
+ // Create a monochrome bitmap for the mask
+ m_hbmMask = ::CreateBitmap(rect.Width(),
+ rect.Height(),
+ 1,
+ 1,
+ NULL);
+ // Select the mono bitmap into its DC
+ HBITMAP hbmOldMask = (HBITMAP)::SelectObject(hdcMask, m_hbmMask);
+ // Select the image bitmap into its DC
+ HBITMAP hbmOldImage = (HBITMAP)::SelectObject(hdcImage, m_hObject);
+ // Set the transparency color to be the top-left pixel
+ ::SetBkColor(hdcImage, ::GetPixel(hdcImage, 0, 0));
+ // Make the mask
+ ::BitBlt(hdcMask,
+ 0, 0,
+ rect.Width(), rect.Height(),
+ hdcImage,
+ xoff, 0,
+ SRCCOPY);
+ ::SelectObject(hdcMask, hbmOldMask);
+ ::SelectObject(hdcImage, hbmOldImage);
+ ::DeleteDC(hdcMask);
+ ::DeleteDC(hdcImage);
+}
+
+/*
+ X,Y Destaination location
+ w, destination width
+ xoff source offset
+*/
+void CTransBmp::DrawTrans(HDC hDC, CRect &rect, int xoff)
+{
+ ASSERT(hDC);
+ if (!m_hbmMask) CreateMask(hDC,rect,xoff);
+ ASSERT(m_hbmMask);
+ int dx = rect.Width();
+ int dy = rect.Height();
+
+ // Create a memory DC to do the drawing to
+ HDC hdcOffScr = ::CreateCompatibleDC(hDC);
+ // Create a bitmap for the off-screen DC that is really
+ // color compatible with the destination DC.
+ HBITMAP hbmOffScr = ::CreateBitmap(dx, dy,
+ (BYTE)GetDeviceCaps(hDC, PLANES),
+ (BYTE)GetDeviceCaps(hDC, BITSPIXEL),
+ NULL);
+ // Select the buffer bitmap into the off-screen DC
+ HBITMAP hbmOldOffScr = (HBITMAP)::SelectObject(hdcOffScr, hbmOffScr);
+
+ // Copy the image of the destination rectangle to the
+ // off-screen buffer DC so we can play with it
+ ::BitBlt(hdcOffScr, 0, 0, dx, dy, hDC, 0, 0, SRCCOPY);
+
+ // Create a memory DC for the source image
+ HDC hdcImage = ::CreateCompatibleDC(hDC);
+ HBITMAP hbmOldImage = (HBITMAP)::SelectObject(hdcImage, m_hObject);
+
+ // Create a memory DC for the mask
+ HDC hdcMask = ::CreateCompatibleDC(hDC);
+ HBITMAP hbmOldMask = (HBITMAP)::SelectObject(hdcMask, m_hbmMask);
+
+ // XOR the image with the destination
+ ::SetBkColor(hdcOffScr,rgbWhite);
+ ::BitBlt(hdcOffScr, 0, 0, dx, dy ,hdcImage, xoff, 0, DSx);
+ // AND the destination with the mask
+ ::BitBlt(hdcOffScr, 0, 0, dx, dy, hdcMask, 0,0, DSa);
+ // XOR the destination with the image again
+ ::BitBlt(hdcOffScr, 0, 0, dx, dy, hdcImage, xoff, 0, DSx);
+
+ // Copy the resultant image back to the screen DC
+ ::BitBlt(hDC, rect.left, rect.top, dx, dy, hdcOffScr, 0, 0, SRCCOPY);
+
+ // Tidy up
+ ::SelectObject(hdcOffScr, hbmOldOffScr);
+ ::SelectObject(hdcImage, hbmOldImage);
+ ::SelectObject(hdcMask, hbmOldMask);
+ ::DeleteObject(hbmOffScr);
+ ::DeleteDC(hdcOffScr);
+ ::DeleteDC(hdcImage);
+ ::DeleteDC(hdcMask);
+}
+
+void CTransBmp::DrawTrans(CDC* pDC,CRect &rect, int xoff)
+{
+ ASSERT(pDC);
+ HDC hDC = pDC->GetSafeHdc();
+ DrawTrans(hDC, rect,xoff);
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// transbmp.h : interface of the CTransBitmap class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+class CTransBmp : public CBitmap
+{
+public:
+ CTransBmp();
+ ~CTransBmp();
+ void Draw(HDC hDC, int x, int y);
+ void Draw(CDC* pDC, int x, int y);
+ void DrawTrans(HDC hDC, CRect &rect,int xoff=0);
+ void DrawTrans(CDC* pDC, CRect &rect,int xoff=0);
+ int GetWidth();
+ int GetHeight();
+ void UpdateMask(CWnd *wnd,CRect &rect);
+private:
+ int m_iWidth;
+ int m_iHeight;
+ HBITMAP m_hbmMask; // handle to mask bitmap
+
+ void GetMetrics();
+ void CreateMask(HDC hDC, CRect &rect,int xoff);
+};
+
+/////////////////////////////////////////////////////////////////////////////
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// TrayIcon.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "TrayIcon.h"
+#include "share.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+IMPLEMENT_DYNAMIC(CTrayIcon, CWnd)
+
+// this is part of MENUBLOCK routine
+//need this type of overload for FIND to work, requires CONST on both sides
+// CList::Find requires a == compare between const MEMBLOCK, by reference defined
+BOOL operator==(const MENUBLOCK &first,const MENUBLOCK &second )
+{
+return (first.mID==second.mID );
+};
+/////////////////////////////////////////////////////////////////////////////
+// CTrayIcon
+
+const UINT CTrayIcon::m_uMsgTaskbarCreated = ::RegisterWindowMessage(_T("TaskbarCreated"));
+const int CTrayIcon::m_uMaxTooltipLength = 64;
+CWnd CTrayIcon::m_wndInvisible;
+
+
+CTrayIcon::CTrayIcon(UINT uCallbackMessage, UINT uIcon, UINT uID)
+{
+ memset(&m_Notify,0,sizeof(m_Notify));
+ ASSERT(uCallbackMessage >= WM_APP);
+ CString sTooltip;
+ sTooltip.LoadString(uID);
+ ASSERT(sTooltip.GetLength()<= m_uMaxTooltipLength);
+ CWnd::CreateEx(0, AfxRegisterWndClass(0), _T(""), WS_POPUP, 0,0,0,0, NULL, 0); /* create an invisable window for this Class*/
+ m_Notify.cbSize = sizeof(NOTIFYICONDATA);
+ m_Notify.uCallbackMessage=uCallbackMessage;
+ m_Notify.hIcon=AfxGetApp()->LoadIcon(uIcon);
+ m_Notify.uID=uID;
+ m_Notify.hWnd = m_hWnd;
+ m_Notify.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
+ _tcsncpy(m_Notify.szTip, sTooltip.GetBuffer(sTooltip.GetLength()), m_uMaxTooltipLength-1);
+ m_iConnectState=1; //set current menu option to Connect
+ m_hParent=NULL;
+}
+
+
+
+CTrayIcon::~CTrayIcon()
+{
+ RemoveIcon();
+ DestroyWindow();
+}
+
+
+BEGIN_MESSAGE_MAP(CTrayIcon, CWnd)
+ //{{AFX_MSG_MAP(CTrayIcon)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ //}}AFX_MSG_MAP
+ ON_REGISTERED_MESSAGE(CTrayIcon::m_uMsgTaskbarCreated, OnTaskbarCreated)
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CTrayIcon message handlers
+
+/*
+typedef struct _NOTIFYICONDATA {
+ DWORD cbSize; // sizeofstruct,youmustset
+ HWND hWnd; // HWND sending notification
+ UINT uID; // IDoficon(callbackWPARAM)
+ UINT uFlags; // see below
+ UINT uCallbackMessage; // sent to your wndproc
+ HICON hIcon; // handle of icon C
+ CHAR szTip[64]; // tip text
+} NOTIFYICONDATA;
+*/
+
+BOOL CTrayIcon::AddIcon(CWnd *pParent)
+{
+ if (m_hParent==NULL)
+ RemoveIcon();
+ m_hParent=pParent->m_hWnd;
+ ASSERT(m_hParent);
+ m_Notify.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
+ if (!Shell_NotifyIcon(NIM_ADD, &m_Notify))
+ m_hParent=NULL;
+ return (m_hParent!=NULL);
+}
+
+BOOL CTrayIcon::RemoveIcon()
+{
+ if (m_hParent==NULL)
+ return TRUE;
+ m_Notify.uFlags = 0;
+ if (Shell_NotifyIcon(NIM_DELETE, &m_Notify))
+ m_hWnd=NULL;
+ return (m_hWnd==NULL);
+}
+
+void CTrayIcon::SetConnectState(int istate)
+{
+ m_iConnectState=istate;
+}
+
+void CTrayIcon::AddDrive(MENUBLOCK &menu)
+{
+ m_MountList.AddTail(menu);
+}
+
+void CTrayIcon::RemoveDrive(MENUBLOCK &menu)
+{
+ POSITION pos=m_MountList.Find(menu);
+ if (pos)
+ m_MountList.RemoveAt(pos);
+}
+
+LRESULT CTrayIcon::OnTrayNotification(UINT wParam, LONG lParam)
+{
+ //Return quickly if its not for this tray icon
+ if (wParam != m_Notify.uID)
+ return 0L;
+ CWnd *pTargetWnd = AfxGetMainWnd();
+ if (!pTargetWnd)
+ return 0L;
+
+ if ((ULONG)wParam!=m_Notify.uID ||
+ (lParam!=WM_RBUTTONUP && lParam!=WM_LBUTTONDBLCLK))
+ return 0;
+
+ // If there's a resource menu with the same ID as the icon, use it as
+ // the right-button popup menu. CTrayIcon will interprets the first
+ // item in the menu as the default command for WM_LBUTTONDBLCLK
+ //
+ CMenu menu;
+ if (!menu.LoadMenu(m_Notify.uID))
+ return 0;
+ CMenu* pSubMenu = menu.GetSubMenu(0);
+ if (!pSubMenu)
+ return 0;
+
+ CString msg;
+ switch (m_iConnectState)
+ {
+ default:
+ msg="&DisConnect";
+ pSubMenu->EnableMenuItem(3,MF_BYPOSITION|MF_GRAYED|MF_DISABLED);
+ break;
+ case 1:
+ msg="&Connect";
+ pSubMenu->EnableMenuItem(3,MF_BYPOSITION|MF_ENABLED);
+ break;
+ case 2: //error state
+ pSubMenu->EnableMenuItem(1,MF_BYPOSITION|MF_GRAYED|MF_DISABLED);
+ pSubMenu->EnableMenuItem(3,MF_BYPOSITION|MF_ENABLED);
+ break;
+ }
+ pSubMenu->ModifyMenu(1,MF_BYPOSITION|MF_STRING,pSubMenu->GetMenuItemID(1),msg);
+ if (m_MountList.GetCount())
+ {
+ pSubMenu->InsertMenu(4,MF_BYPOSITION,MF_SEPARATOR);
+ POSITION pos=m_MountList.GetHeadPosition();
+ LPMENUBLOCK pmenu;//=&m_MountList.GetAt(pos);
+ while (pos)
+ {
+ pmenu=&m_MountList.GetNext(pos);
+ pSubMenu->InsertMenu(5,MF_BYPOSITION,pmenu->mID,pmenu->title);
+ }
+ }
+
+ if (lParam==WM_RBUTTONUP) {
+
+ // Make first menu item the default (bold font)
+ ::SetMenuDefaultItem(pSubMenu->m_hMenu, 0, TRUE);
+
+ // SetForegroundWindow. see Q135788 in MSDN.
+ CPoint mouse;
+ GetCursorPos(&mouse);
+ ::SetForegroundWindow(m_Notify.hWnd);
+ ::TrackPopupMenu(pSubMenu->m_hMenu, 0, mouse.x, mouse.y, 0,
+ pTargetWnd->GetSafeHwnd(), NULL);
+ pTargetWnd->PostMessage(WM_NULL, 0, 0);
+ menu.DestroyMenu();
+
+ } else // double click: execute first menu item
+ ::SendMessage(m_hParent, WM_COMMAND, pSubMenu->GetMenuItemID(0), 0);
+
+ return 1; // handled
+}
+
+LRESULT CTrayIcon::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ if (message == m_Notify.uCallbackMessage)
+ return OnTrayNotification(wParam, lParam);
+
+ return CWnd::WindowProc(message, wParam, lParam);
+}
+
+BOOL CTrayIcon::RemoveTaskbarIcon(CWnd* pWnd)
+{
+ LPCTSTR pstrOwnerClass = AfxRegisterWndClass(0);
+
+ // Create static invisible window
+ if (!::IsWindow(m_wndInvisible.m_hWnd))
+ {
+ if (!m_wndInvisible.CreateEx(0, pstrOwnerClass, _T(""), WS_POPUP,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+ NULL, 0))
+ return FALSE;
+ }
+
+ pWnd->SetParent(&m_wndInvisible);
+
+ return TRUE;
+}
+
+void CTrayIcon::MinimiseToTray(CWnd* pWnd)
+{
+
+ RemoveTaskbarIcon(pWnd);
+ pWnd->ModifyStyle(WS_VISIBLE, 0);
+}
+
+void CTrayIcon::MaximiseFromTray(CWnd* pWnd)
+{
+ pWnd->SetParent(NULL);
+
+ pWnd->ModifyStyle(0, WS_VISIBLE);
+ pWnd->RedrawWindow(NULL, NULL, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_FRAME |
+ RDW_INVALIDATE | RDW_ERASE);
+
+ // Move focus away and back again to ensure taskbar icon is recreated
+ if (::IsWindow(m_wndInvisible.m_hWnd))
+ m_wndInvisible.SetActiveWindow();
+ pWnd->SetActiveWindow();
+ pWnd->SetForegroundWindow();
+}
+
+void CTrayIcon::OnTaskbarCreated(WPARAM , LPARAM )
+{
+ if (m_hParent==NULL)
+ return;
+ m_Notify.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
+ Shell_NotifyIcon(NIM_ADD, &m_Notify);
+}
+
+CWnd * CTrayIcon::m_pwTrayIcon=NULL;
+
+BOOL CALLBACK EnumChildProc(
+ HWND hWnd, // handle to child window
+ LPARAM lParam // application-defined value
+ )
+{
+ CWnd *wnd=CWnd::FromHandle(hWnd);
+ CString msg;
+ wnd->GetWindowText(msg);
+ CTrayIcon::m_pwTrayIcon=wnd;
+ HICON ic=wnd->GetIcon(FALSE);
+ return TRUE;
+}
+
+BOOL CALLBACK EFindTrayWnd(HWND hwnd, LPARAM lParam)
+{
+ TCHAR szClassName[256];
+ GetClassName(hwnd, szClassName, 255);
+
+ // Did we find the Main System Tray? If so, then get its size and keep going
+ if (_tcscmp(szClassName, _T("TrayNotifyWnd")) == 0)
+ {
+ CTrayIcon::m_pwTrayIcon=CWnd::FromHandle(hwnd);
+ return FALSE;
+ }
+ return TRUE;
+
+}
+
+CWnd * CTrayIcon::FindTrayWnd()
+{
+ HWND hShellTrayWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
+ if (!hShellTrayWnd) return NULL;
+ EnumChildWindows(hShellTrayWnd, EFindTrayWnd, (LPARAM)0);
+
+ if (!EnumChildWindows(
+ m_pwTrayIcon->m_hWnd, // handle to parent window
+ EnumChildProc, // callback function
+ 0))
+ return NULL;
+ return m_pwTrayIcon;
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(AFX_TRAYICON_H__60C86242_1890_11D5_A375_00105A6BCA62__INCLUDED_)
+#define AFX_TRAYICON_H__60C86242_1890_11D5_A375_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+// TrayIcon.h : header file
+//
+class MENUBLOCK
+{ //used to pass info to the Tray icon
+public:
+ MENUBLOCK(){mID=-1;}
+ MENUBLOCK(UINT id,const char *msg){
+ mID=id;
+ title=msg;
+ }
+ ~MENUBLOCK(){};
+ MENUBLOCK& operator=(MENUBLOCK &other){
+ mID=other.mID;
+ title=other.title;
+ return *this;
+ }
+ friend BOOL operator==(const MENUBLOCK &first, const MENUBLOCK &second );
+ int mID;
+ CString title;
+};
+
+typedef MENUBLOCK * LPMENUBLOCK;
+
+/////////////////////////////////////////////////////////////////////////////
+// CTrayIcon window
+
+class CTrayIcon : public CWnd
+{
+// Construction
+public:
+ CTrayIcon(UINT uCallbackMessage, UINT uIcon, UINT uID);
+
+// Attributes
+public:
+ static const UINT m_uMsgTaskbarCreated; /*RegisterWindowMessage(_T("TaskbarCreated"))*/
+ static CWnd m_wndInvisible;
+ static CWnd * m_pwTrayIcon;
+
+// Operations
+public:
+ static CWnd * FindTrayWnd();
+ void SetConnectState(int istate);
+ void AddDrive(MENUBLOCK &menu);
+ void RemoveDrive(MENUBLOCK &menu);
+ BOOL SetIcon(HICON hIcon);
+ BOOL SetIcon(LPCTSTR lpszIconName);
+ BOOL SetIcon(UINT nIDResource);
+ BOOL SetStandardIcon(LPCTSTR lpIconName);
+ BOOL SetStandardIcon(UINT nIDResource);
+ HICON GetIcon() const;
+
+ void SetFocus();
+ BOOL HideIcon();
+ BOOL ShowIcon();
+ BOOL AddIcon(CWnd *pParent);
+ BOOL RemoveIcon();
+ BOOL IsIconOnTray(){return (m_hParent!=NULL);}
+
+ void MinimiseToTray(CWnd* pWnd);
+ void MaximiseFromTray(CWnd* pWnd);
+ BOOL RemoveTaskbarIcon(CWnd* pWnd);
+
+ // Default handler for tray notification message
+ virtual LRESULT OnTrayNotification(WPARAM uID, LPARAM lEvent);
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CTrayIcon)
+ protected:
+ virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CTrayIcon();
+
+ DECLARE_DYNAMIC(CTrayIcon)
+
+ // Generated message map functions
+protected:
+ void OnTaskbarCreated(WPARAM, LPARAM);
+ HWND m_hParent; /* Parent window to send messages too e.g. WinAFsLoadDlg*/
+ CList<MENUBLOCK,MENUBLOCK&> m_MountList;
+ int m_iConnectState;
+ NOTIFYICONDATA m_Notify;
+ static const int m_uMaxTooltipLength;
+ UINT m_DefaultMenuItemID;
+ BOOL m_DefaultMenuItemByPos;
+
+ //{{AFX_MSG(CTrayIcon)
+ // NOTE - the ClassWizard will add and remove member functions here.
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_TRAYICON_H__60C86242_1890_11D5_A375_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+// Wait.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "winafsload.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CWait
+
+int CWait::m_RefCount=0;
+
+CWait::CWait(LPCTSTR cursor)
+{
+ m_RefCount++;
+ m_Cursor=SetCursor(LoadCursor(NULL,cursor));
+}
+
+BOOL CWait::IsBusy()
+{
+ return (m_RefCount!=0);
+}
+
+CWait::~CWait()
+{
+ SetCursor(m_Cursor);
+ m_RefCount--;
+}
+
+
+BEGIN_MESSAGE_MAP(CWait, CWnd)
+ //{{AFX_MSG_MAP(CWait)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CWait message handlers
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#if !defined(AFX_WAIT_H__F7E2A603_FBFD_11D3_A374_00105A6BCA62__INCLUDED_)
+#define AFX_WAIT_H__F7E2A603_FBFD_11D3_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// Wait.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CWait window
+
+class CWait : public CWnd
+{
+// Construction
+public:
+ CWait(LPCTSTR cursor=IDC_WAIT);
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CWait)
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CWait();
+ static BOOL IsBusy();
+
+ // Generated message map functions
+protected:
+ static int m_RefCount;
+ HCURSOR m_Cursor;
+ //{{AFX_MSG(CWait)
+ // NOTE - the ClassWizard will add and remove member functions here.
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_WAIT_H__F7E2A603_FBFD_11D3_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+// WinAfsLoad.cpp : Defines the class behaviors for the application.
+//
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#include "stdafx.h"
+#include "WinAfsLoad.h"
+#include "WinAfsLoadDlg.h"
+#include "cregkey.h"
+#include "api95.h"
+#include "termwarn.h"
+#include "myframe.h"
+#include "afsmsg95.h"
+#include "Tlhelp32.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinAfsLoadApp
+
+BEGIN_MESSAGE_MAP(CWinAfsLoadApp, CWinApp)
+ //{{AFX_MSG_MAP(CWinAfsLoadApp)
+ //}}AFX_MSG_MAP
+ ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+ ON_THREAD_MESSAGE(WM_UIONPARM,OnNotifyReturn)
+ ON_THREAD_MESSAGE(WSA_EVENT, OnAfsEvent)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinAfsLoadApp construction
+
+CWinAfsLoadApp::CWinAfsLoadApp()
+{
+ // TODO: add construction code here,
+ // Place all significant initialization in InitInstance
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CWinAfsLoadApp object
+
+CWinAfsLoadApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinAfsLoadApp initialization
+
+HWND CWinAfsLoadApp::m_hAfsLoadFinish=0;
+HWND CWinAfsLoadApp::m_hAfsLoad=0;
+CString CWinAfsLoadApp::m_sDosAppName;
+/*
+ DWORD dwProcessID;
+ ::GetWindowThreadProcessId (hWnd, &dwProcessID);
+*/
+BOOL CALLBACK CWinAfsLoadApp::EnumWindowsProc(HWND hWnd, LPARAM lParam)
+{
+ CWnd *wnd=CWnd::FromHandle(hWnd);
+ CString msg;
+ CString sFinish;
+ wnd->GetWindowText(msg);
+ if ( (!m_sDosAppName.IsEmpty())
+ && (m_sDosAppName!=""))
+ {
+ if (msg==m_sDosAppName)
+ m_hAfsLoad=hWnd;
+ sFinish.Format("Finished - %s",m_sDosAppName);
+ if (msg==sFinish)
+ m_hAfsLoadFinish=hWnd;
+ }
+ if (msg==DOSTITLE)
+ m_hAfsLoad=hWnd;
+ if ((msg==DOSTITLEFINISH)||(msg==APPTITLEFINISH))
+ m_hAfsLoadFinish=hWnd;
+ return ((m_hAfsLoad==0) && (m_hAfsLoadFinish==0));
+}
+
+int CWinAfsLoadApp::ExitInstance()
+{
+ // TODO: Add your specialized code here and/or call the base class
+ if (m_pCMyUIThread)
+ {
+ SetNotifyEventSuspend();
+ m_pCMyUIThread->PostThreadMessage(WM_UIONPARM,ONPARMCLOSE,0);
+ WaitForSingleObject(CMyUIThread::m_hEventThreadKilled, INFINITE);
+ CloseHandle(CMyUIThread::m_hEventThreadKilled);
+ m_pCMyUIThread=NULL;
+ }
+ return CWinApp::ExitInstance();
+}
+
+BOOL CWinAfsLoadApp::InitInstance()
+{
+ HWND hwnd=FindWindow(NULL,"AFS Activity Log");
+ CString msg;
+ msg.LoadString(IDD_ACTIVITYLOG);
+ if (hwnd)
+ {
+ ::PostMessage(hwnd,WM_SYSCOMMAND,IDM_VISIBLE,0);
+ return FALSE;
+ }
+ EnumWindows (CWinAfsLoadApp::EnumWindowsProc, (LPARAM) 0); //lets grab other open windows and close them down
+ if (!AfxSocketInit())
+ {
+ AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
+ return FALSE;
+ }
+
+ // Standard initialization
+ // If you are not using these features and wish to reduce the size
+ // of your final executable, you should remove from the following
+ // the specific initialization routines you do not need.
+
+#ifdef _AFXDLL
+ Enable3dControls(); // Call this when using MFC in a shared DLL
+#else
+ Enable3dControlsStatic(); // Call this when linking to MFC statically
+#endif
+
+ PCHAR pPath=getenv("AFSCONF");
+ m_sTargetDir.Empty();
+ if (!pPath)
+ AfxMessageBox("AFS Error - Improper installation, Enviornemnt variable AFSCONF missing",MB_ICONWARNING | MB_OK);
+ else
+ m_sTargetDir.Format("%s\\",pPath);
+
+// CString t(m_sTargetDir);
+// t+="afs-light.hlp";
+
+ m_pszHelpFilePath=_tcsdup(_T("afswin9x.hlp"));
+// initialize variables
+ CRegkey regkey("AFS\\Window");
+ if (regkey.Getkey()!=0)
+ {
+ DWORD len=64;
+ regkey.GetString("Title",m_sDosAppName,len);
+ }
+ RegOptions(TRUE);
+
+ if ((m_pCMyUIThread=(CMyUIThread *)AfxBeginThread(RUNTIME_CLASS(CMyUIThread)),THREAD_PRIORITY_IDLE)==NULL)
+ {// need to create a very low priority else it will interfere with other windows
+ AfxMessageBox("Error creating background thread for progress bar! /nApplicaton still operational.");
+ m_pCMyUIThread=NULL;
+ } else
+ m_pCMyUIThread->m_hEventThreadKilled //used to test when thread is done
+ = CreateEvent(NULL, FALSE, FALSE, NULL); // auto reset, initially reset
+ // scan for command line options
+ // show userid: password: connect
+ CharLower(m_lpCmdLine);
+ m_bShowAfs=(strstr(m_lpCmdLine,"show")!=NULL);
+ if (m_bLogWindow)
+ ShowLog(TRUE);
+ if (m_bLog)
+ ShowPrint(TRUE);
+ char *str=NULL;
+ CString cUserName;
+ strlwr(m_lpCmdLine); //convert to lower case
+ if ((str=strstr(m_lpCmdLine,"userid:"))!=NULL) //
+ {
+ cUserName=(strstr(str,":"));
+ }
+ CString cPassWord;
+ if ((str=strstr(m_lpCmdLine,"password:"))!=NULL)
+ {
+ cPassWord=(strstr(str,":"));
+ }
+// BOOL bConnect=(strstr(m_lpCmdLine,"connect")!=NULL);
+
+ if (m_hAfsLoadFinish) // SOME REASON THE WINDOW WAS NOT SHUT DOWN, SO LETES KILL IT
+ {
+ ::SendMessage(m_hAfsLoadFinish,WM_CLOSE,0,0);
+ LOG("WM_CLOSE");
+ }
+ if (m_hAfsLoad) // Something wrong, BACKGROUND is running without dialog
+ {
+ CTermWarn *pModeless = new CTermWarn(NULL);
+ pModeless->Create();
+ pModeless->SetActiveWindow();
+ ShutdownAfs();
+ CTime startTime = CTime::GetCurrentTime();
+ CTimeSpan elapsedTime;
+ do
+ {
+ Sleep(500);
+ m_hAfsLoad=0;
+ EnumWindows (EnumWindowsProc, (LPARAM) 0); //lets prevent multiple instances!
+ elapsedTime= CTime::GetCurrentTime() - startTime;
+ if (elapsedTime.GetTotalSeconds()>10)
+ {
+ if (pModeless)
+ pModeless->OnCancel();
+ ::ShowWindow(m_hAfsLoad,SW_SHOWNORMAL);
+ ::AfxMessageBox("AFS Error - Warning AFS Client Console still running.\n Locate the console and use Control C to manually terminate it!");
+ return FALSE;
+ }
+ } while (m_hAfsLoad);
+ if (m_hAfsLoadFinish) // SOME REASON THE WINDOW WAS NOT SHUT DOWN, SO LETES KILL IT
+ {
+ ::SendMessage(m_hAfsLoadFinish,WM_CLOSE,0,0);
+ LOG("WM_CLOSE");
+ }
+ if (pModeless)
+ pModeless->OnCancel();
+ }
+ CWinAfsLoadDlg dlg(cUserName,cPassWord);
+ m_pMainWnd = &dlg;
+ int nResponse = dlg.DoModal();
+ if (nResponse == IDOK)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with OK
+ }
+ else if (nResponse == IDCANCEL)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with Cancel
+ }
+
+ // Since the dialog has been closed, return FALSE so that we exit the
+ // application, rather than start the application's message pump.
+ return TRUE;
+}
+
+BOOL CWinAfsLoadApp::RegOptions(BOOL fetch)
+{
+ CRegkey regkey("AFS\\Window");
+ if (regkey.Getkey()==0) return FALSE;
+ DWORD w=0;
+ DWORD len=sizeof(w);
+ if (fetch)
+ {
+ regkey.GetBinary("CommandSettings",(LPBYTE)(&w),len);
+ m_bLogWindow=((w & 2)!=0);
+ m_bLog=((w & 4)!=0);
+ m_bConnect=((w & 1)!=0);
+ } else
+ {
+ w=((m_bLogWindow)?2:0) | ((m_bLog)?4:0) | ((m_bConnect)?1:0);
+ regkey.PutBinary("CommandSettings",(LPBYTE)(&w),sizeof(DWORD));
+ }
+ return TRUE;
+}
+
+void CWinAfsLoadApp::Log(const char *s)
+{
+ TRACE("%s\n",s);
+ if ((!m_bLogWindow) && (!m_bLog)) return;
+ if (s)
+ {
+ SYSTEMTIME timeDest;
+ GetSystemTime(&timeDest);
+ CString *mt=new CString; //release is handled by CMyUIThread
+ mt->Format("(%02d:%02d:%2d-%03d)%s\r\n",
+ timeDest.wHour,
+ timeDest.wMinute,
+ timeDest.wSecond,
+ timeDest.wMilliseconds,s);
+ m_pCMyUIThread->PostThreadMessage(WM_LOG,0,(LPARAM)mt);
+ }
+ else
+ m_pCMyUIThread->PostThreadMessage(WM_LOG,0,0);
+}
+
+void CWinAfsLoadApp::Log(const char *f,const DWORD d)
+{
+ CString msg;
+ msg.Format(f,d);
+ Log(msg);
+}
+
+void CWinAfsLoadApp::Log(const char *f,const DWORD d,const DWORD d2)
+{
+ CString msg;
+ msg.Format(f,d,d2);
+ Log(msg);
+}
+
+void CWinAfsLoadApp::Log(const char *f,const char*s)
+{
+ CString msg;
+ msg.Format(f,s);
+ Log(msg);
+}
+
+void CWinAfsLoadApp::Log(const char *f,const char*s,const char*s2)
+{
+ CString msg;
+ msg.Format(f,s,s2);
+ Log(msg);
+}
+
+void CWinAfsLoadApp::Log(const char *f,const char*s,const char*s2,const char*s3)
+{
+ CString msg;
+ msg.Format(f,s,s2,s3);
+ Log(msg);
+}
+
+void CWinAfsLoadApp::ShowLog(BOOL yes)
+{
+ m_pCMyUIThread->PostThreadMessage(WM_LOG,LOGSHOWWINDOW,yes);
+}
+
+void CWinAfsLoadApp::ShowPrint(BOOL yes)
+{
+ CString *mp=new CString();
+ mp->Format("%s\\afscli.log",getenv("AFSCONF"));
+ m_pCMyUIThread->PostThreadMessage(WM_LOG,LOGSHOWPRINT,(yes)?(LPARAM)mp:NULL);
+}
+
+void CWinAfsLoadApp::Progress(VOID *ptr, UINT mode)
+{
+ // you cannot obtain the handle to the window int these routines so you have enough time to create the window
+ // It is ok to postmessage to a window in a different thread!
+ if (m_pCMyUIThread==NULL) return;
+ switch (mode)
+ {
+ case ProgFSetTitle:
+ ::PostMessage(((CDialog *)m_pCMyUIThread->GetMainWnd())->GetSafeHwnd()
+ ,WM_PROGRESSPARM,ProgFSetTitle,(LPARAM)ptr);
+ break;
+ case ProgFHide:
+ ::PostMessage(((CDialog *)m_pCMyUIThread->GetMainWnd())->GetSafeHwnd()
+ ,WM_PROGRESSPARM,ProgFHide,0);
+ break;
+ case ProgFNext:
+ ::PostMessage(((CDialog *)m_pCMyUIThread->GetMainWnd())->GetSafeHwnd(),WM_PROGRESSPARM,ProgFNext,0);
+ BringWindowToTop(((CDialog *)m_pCMyUIThread->GetMainWnd())->GetSafeHwnd());
+ break;
+ default:
+ ::PostMessage(((CDialog *)m_pCMyUIThread->GetMainWnd())->GetSafeHwnd(),WM_PROGRESSPARM,ProgFOpt,mode);
+ BringWindowToTop(((CDialog *)m_pCMyUIThread->GetMainWnd())->GetSafeHwnd());
+ ((CDialog *)m_pCMyUIThread->GetMainWnd())->CenterWindow((CWnd *)ptr);
+ case 0:
+ break;
+ }
+}
+
+void CWinAfsLoadApp::RequestUISuspendEvent(UINT mode)
+{
+ SetNotifyEventSuspend();
+ m_pCMyUIThread->PostThreadMessage(WM_UIONPARM,mode,0);
+}
+
+void CWinAfsLoadApp::RequestUIPostEvent(UINT mode,WPARAM wp,LPARAM lp)
+{
+ SetNotifyEventPostMessage();
+ m_pCMyUIThread->PostThreadMessage(mode,wp,lp);
+}
+
+
+/*
+There is no queue for messages (only one event) therefore messages passed to us
+are not queued and stored in m_sMsg & m_wParam;
+*/
+
+void CWinAfsLoadApp::SetNotifyEventSuspend()
+{
+ ResetEvent(CMyUIThread::m_hEventThreadKilled);
+ m_uNotifyMessage=1;
+}
+
+void CWinAfsLoadApp::WaitForEvent(UINT logintime,WPARAM *wp,CString *msg)
+{
+ switch (WaitForSingleObject(CMyUIThread::m_hEventThreadKilled, logintime))
+ {
+ case WAIT_OBJECT_0:
+ LOG("OnAfsEvent - Receive Good Status ");
+ *msg=m_sMsg;
+ break;
+ default:
+ *wp=AFS_EXITCODE_GENERAL_FAILURE;
+ *msg="AFS Client timed out, failure to respond\r\nCheck Network Connection.";
+ LOG("OnAfsEvent %s",(const char *)*msg);
+ return;
+ }
+ *wp=m_wParam;
+}
+
+/*
+Tthis funciton is called from UIThread (different thread)
+ and should not contain and Windows stuff assocaited with CWinAFSLoad.
+It is used to display messages from a backgound process or during PowerSuspend denial
+NOTICE: PostThreadMessage leaves deletion of message up to caller
+ WaitEvent does not have to delete message because Wait is not queued like PostMessage
+*/
+void CWinAfsLoadApp::WSANotifyFromUI(WPARAM wp,const char *msg)
+{
+ TRACE("CWinAfsLoadApp::Notify wp=%d,msg=[%s]\n",wp,msg);
+ switch (m_uNotifyMessage)
+ {
+ case 2:
+ {// for post message use allocated memory to hold results and pass back to main thread
+ CString *mp=new CString; //memory is released by destination routine!
+ *mp=msg;
+ PostThreadMessage(WSA_EVENT,wp,(LPARAM)mp); //this goes to WSA_EVENT
+ }
+ break;
+ case 1:
+ // For setting the Event completion, pass information back to calling thread
+ m_wParam=wp;
+ m_sMsg=msg;
+ SetEvent(CMyUIThread::m_hEventThreadKilled);
+ m_uNntifyMessage=0;
+ break;
+ default:
+ break;
+ }
+}
+
+void CWinAfsLoadApp::NotifyFromUI(WPARAM wp,const char *msg)
+{// called from UIThread to notify return status
+ CString *mp=NULL;
+ if (msg)
+ {
+ mp=new CString; //memory is released by destination routine!
+ *mp=msg;
+ TRACE("CWinAfsLoadApp::Notify wp=%d,msg=[%s]\n",wp,msg);
+ } else
+ TRACE("CWinAfsLoadApp::Notify wp=%d,msg=NULL\n",wp);
+ if (wp)
+ PostThreadMessage(WM_UIONPARM,wp,(LPARAM)mp);
+}
+
+LRESULT CWinAfsLoadApp::OnNotifyReturn(WPARAM wParam, LPARAM lParam)
+{
+ if (m_pMainWnd)
+ return ((CWinAfsLoadDlg *)m_pMainWnd)->OnNotifyReturn(wParam,lParam);
+ return TRUE;
+}
+
+LRESULT CWinAfsLoadApp::OnAfsEvent(WPARAM wParam, LPARAM lParam)
+{
+ if (m_pMainWnd)
+ return ((CWinAfsLoadDlg *)m_pMainWnd)->OnAfsEvent(wParam,lParam);
+ return TRUE;
+}
+
--- /dev/null
+# Dependency File, included by WinAfsLoad.mak
+
+.\Encript.cpp : \
+ ".\cafs.h"\
+ ".\Datalog.h"\
+ ".\encript.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Transbmp.h"\
+ ".\TrayIcon.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+ ".\WinAfsLoadDlg.h"\
+
+
+.\api95.cpp : \
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+
+
+.\CAfs.cpp : \
+ ".\api95.h"\
+ ".\cafs.h"\
+ ".\CRegkey.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+.\Change.cpp : \
+ ".\cafs.h"\
+ ".\Change.h"\
+ ".\Datalog.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Transbmp.h"\
+ ".\TrayIcon.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+ ".\WinAfsLoadDlg.h"\
+
+
+.\CommandSettings.cpp : \
+ ".\CommandSettings.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+
+.\CRegkey.cpp : \
+ ".\CRegkey.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+
+
+.\Datalog.cpp : \
+ ".\cafs.h"\
+ ".\Datalog.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Transbmp.h"\
+ ".\TrayIcon.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+ ".\WinAfsLoadDlg.h"\
+
+
+.\Force.cpp : \
+ ".\Force.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+
+.\modver.cpp : \
+ ".\modver.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+
+
+.\MyFrame.cpp : \
+ ".\Datalog.h"\
+ ".\MyFrame.h"\
+ ".\ProgBarDlg.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+
+.\ProgBarDlg.cpp : \
+ ".\MyFrame.h"\
+ ".\ProgBarDlg.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+
+.\Retry.cpp : \
+ ".\Retry.h"\
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+
+.\Settings.cpp : \
+ ".\cafs.h"\
+ ".\Datalog.h"\
+ ".\Settings.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Transbmp.h"\
+ ".\TrayIcon.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+ ".\WinAfsLoadDlg.h"\
+
+
+.\StdAfx.cpp : \
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+
+
+.\TermWarn.cpp : \
+ ".\StdAfx.h"\
+ ".\TermWarn.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+
+.\Transbmp.cpp : \
+ ".\StdAfx.h"\
+ ".\Transbmp.h"\
+ ".\Wait.h"\
+
+
+.\TrayIcon.cpp : \
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\TrayIcon.h"\
+ ".\Wait.h"\
+
+
+.\Wait.cpp : \
+ ".\StdAfx.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+
+
+.\WinAfsLoad.cpp : \
+ ".\api95.h"\
+ ".\cafs.h"\
+ ".\CRegkey.h"\
+ ".\Datalog.h"\
+ ".\MyFrame.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\TermWarn.h"\
+ ".\Transbmp.h"\
+ ".\TrayIcon.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+ ".\WinAfsLoadDlg.h"\
+
+
+.\WinAfsLoad.rc : \
+ ".\res\WinAfsLoad.ico"\
+ ".\res\world.bmp"\
+
+
+.\WinAfsLoadDlg.cpp : \
+ ".\cafs.h"\
+ ".\Change.h"\
+ ".\CommandSettings.h"\
+ ".\CRegkey.h"\
+ ".\Datalog.h"\
+ ".\encript.h"\
+ ".\Force.h"\
+ ".\modver.h"\
+ ".\MyFrame.h"\
+ ".\ProgBarDlg.h"\
+ ".\Retry.h"\
+ ".\Settings.h"\
+ ".\share.h"\
+ ".\StdAfx.h"\
+ ".\Transbmp.h"\
+ ".\TrayIcon.h"\
+ ".\Wait.h"\
+ ".\WinAfsLoad.h"\
+ ".\WinAfsLoadDlg.h"\
+
--- /dev/null
+// WinAfsLoad.h : main header file for the WINAFSLOAD application
+//
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#define AFSTITLE "AFS Control Panel"
+
+#if !defined(AFX_WINAFSLOAD_H__75E145B3_F5C0_11D3_A374_00105A6BCA62__INCLUDED_)
+#define AFX_WINAFSLOAD_H__75E145B3_F5C0_11D3_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+ #error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // main symbols
+
+#define LOG ((CWinAfsLoadApp *)AfxGetApp())->Log
+//#define LOG1(p) ((CWinAfsLoadApp *)AfxGetApp())->Log(p)
+//#define LOG2(p1,p2) ((CWinAfsLoadApp *)AfxGetApp())->Log(p1,p2)
+//#define LOG3(p1,p2,p3) ((CWinAfsLoadApp *)AfxGetApp())->Log(p1,p2,p3)
+#define SHOWLOG(p1) ((CWinAfsLoadApp *)AfxGetApp())->ShowLog(p1)
+#define PROGRESS(p1,p2) ((CWinAfsLoadApp *)AfxGetApp())->Progress(p1,p2)
+#define REQUESTUIPOSTEVENT ((CWinAfsLoadApp *)AfxGetApp())->RequestUIPostEvent
+#define REQUESTUISUSPENDEVENT ((CWinAfsLoadApp *)AfxGetApp())->RequestUISuspendEvent
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinAfsLoadApp:
+// See WinAfsLoad.cpp for the implementation of this class
+//
+class CDatalog;
+class CMyUIThread;
+
+class CWinAfsLoadApp : public CWinApp
+{
+ friend class CProgBarDlg;
+ friend class CMyUIThread;
+ void WSANotifyFromUI(WPARAM, const char *);
+ void NotifyFromUI(WPARAM, const char *);
+public:
+ CString m_sMsg; //used to pass error messages to calling thread
+ CMyUIThread* m_pCMyUIThread;
+ BOOL m_bShowAfs,m_bLog,m_bLogWindow,m_bConnect;
+ static CString m_sDosAppName;
+ CWinAfsLoadApp();
+ void Log(const char *);
+ void Log(const char *,const char*);
+ void Log(const char *,const DWORD);
+ void Log(const char *,const DWORD,const DWORD);
+ void Log(const char *,const char*,const char*);
+ void Log(const char *f,const char*,const char*,const char*);
+ void ShowLog(BOOL);
+ void ShowPrint(BOOL);
+ void Progress(VOID *wnd, UINT mode);
+ void WaitForEvent(UINT sec,WPARAM *wp,CString *msg);
+ void GetNotifyState(WPARAM *wp,LPARAM *lp);
+ void RequestUISuspendEvent(UINT mode);
+ void RequestUIPostEvent(UINT mode,WPARAM wp,LPARAM lp);
+ void SetNotifyEventSuspend();
+ void SetNotifyEventPostMessage(){m_uNotifyMessage=2;}
+ void ClearNotify(){m_uNotifyMessage=0;}
+ BOOL RegOptions(BOOL fetch);
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CWinAfsLoadApp)
+ public:
+ virtual BOOL InitInstance();
+ virtual int ExitInstance();
+ //}}AFX_VIRTUAL
+
+// Implementation
+ BOOL static CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
+ HWND static m_hAfsLoad,m_hAfsLoadFinish;
+ CString m_sTargetDir; //location of afsd.exe
+ UINT m_uEvent;
+ UINT m_uNotifyMessage;
+ WPARAM m_wParam;
+#if NOKNOK
+ BOOL m_bNokNok;
+#endif
+
+ //{{AFX_MSG(CWinAfsLoadApp)
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+ afx_msg LRESULT OnNotifyReturn(WPARAM wParam, LPARAM lParam);
+ afx_msg LRESULT OnAfsEvent(WPARAM wParam, LPARAM lParam);
+};
+
+#define CWINAFSLOADAPP ((CWinAfsLoadApp *)AfxGetApp())
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_WINAFSLOAD_H__75E145B3_F5C0_11D3_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+//generated resource script.
+//
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#include "resource.h"
+
+// Generated Help ID header file
+#define APSTUDIO_HIDDEN_SYMBOLS
+#undef APSTUDIO_HIDDEN_SYMBOLS
+#define APSTUDIO_READONLY_SYMBOLS
+#define HIDC_STATIC 0x80fcffff // IDD_SETTINGS
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+ "#define _AFX_NO_OLE_RESOURCES\r\n"
+ "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+ "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+ "\r\n"
+ "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+ "#ifdef _WIN32\r\n"
+ "LANGUAGE 9, 1\r\n"
+ "#pragma code_page(1252)\r\n"
+ "#endif //_WIN32\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About WinAfsLoad"
+FONT 8, "MS Sans Serif"
+BEGIN
+ ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
+ LTEXT "WinAfsLoad Version ",IDC_STATICABOUT,40,10,119,8,
+ SS_NOPREFIX
+ LTEXT "Copyright (C) 2000",IDC_STATIC,40,25,119,8
+ DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
+END
+
+IDD_WINAFSLOAD_DIALOG DIALOGEX 0, 0, 280, 215
+STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "AFS Control Panel"
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+ EDITTEXT IDC_USERNAME,81,14,73,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_PASSWORD,81,32,73,12,ES_PASSWORD | ES_AUTOHSCROLL
+ PUSHBUTTON "&Connect",IDC_CONNECT,223,7,50,14
+ PUSHBUTTON "Exit",IDC_CANCEL,223,47,50,14
+ CONTROL "Save Password",IDC_SAVEUSERNAME,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,82,49,78,10
+ CONTROL "Advanced Options",IDC_CHECKADVANCED,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,198,69,75,10
+ CONTROL "List1",IDC_DRIVEMOUNTLIST,"SysListView32",LVS_REPORT |
+ LVS_NOLABELWRAP | WS_BORDER | WS_TABSTOP,17,99,246,85
+ PUSHBUTTON "Add",IDC_ADD,17,188,42,14
+ PUSHBUTTON "Change",IDC_CHANGE,67,188,42,14,WS_DISABLED
+ PUSHBUTTON "Remove",IDC_REMOVE,117,188,42,14,WS_DISABLED
+ PUSHBUTTON "ReAuthenicate",IDC_AUTH,163,7,55,14,WS_DISABLED
+ PUSHBUTTON "S&ettings",IDC_SETTINGS,223,27,50,14
+ LTEXT "&UserName:",IDC_STATIC,37,15,36,8
+ LTEXT "&Password:",IDC_STATIC,39,34,33,8
+ GROUPBOX "",IDC_OPTIONLINE,7,78,266,9,NOT WS_VISIBLE
+ LTEXT "Static",IDC_MOUNTDISPLAY,50,89,142,8
+ LTEXT "* Connect Drive Letter Map Point when AFS connected.",
+ IDC_STATIC,169,187,104,21
+ CTEXT "",IDC_AUTHWARN,31,65,162,13,SS_CENTERIMAGE | NOT
+ WS_VISIBLE | NOT WS_GROUP,WS_EX_TRANSPARENT
+ PUSHBUTTON "Help",IDC_HELPMAIN,166,46,50,14
+ GROUPBOX "",IDC_WORLD,7,7,15,17,NOT WS_VISIBLE
+END
+
+IDD_ACTIVITYLOG DIALOG DISCARDABLE 0, 0, 256, 133
+STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "AFS Activity Log"
+FONT 8, "MS Sans Serif"
+BEGIN
+ EDITTEXT IDC_EDIT,7,7,242,119,ES_MULTILINE | ES_AUTOVSCROLL |
+ ES_READONLY | ES_WANTRETURN | WS_VSCROLL | NOT
+ WS_TABSTOP
+END
+
+IDD_AFSCHANGE DIALOG DISCARDABLE 0, 0, 302, 147
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "AFS - Add/Change"
+FONT 8, "MS Sans Serif"
+BEGIN
+ LTEXT "Drive",IDC_STATIC,21,49,22,8
+ LTEXT "You can map drive letters on your computer to directory paths in AFS.",
+ IDC_STATIC,12,7,283,8
+ LTEXT "For instance, if you map drive Q as /afs/acme.com/usr/bob, then the files available in AFS as /afs/acme.com/usr/bob/* will be visible in your computer's Q:\\ directory.",
+ IDC_STATIC,12,19,283,16
+ LTEXT "AFS &Path:",IDC_STATIC,22,67,33,8
+ EDITTEXT IDC_PATH,70,65,168,13,ES_AUTOHSCROLL
+ LTEXT "Share Name",IDC_STATIC,22,86,38,8
+ EDITTEXT IDC_DESCRIPTION,70,84,72,13,ES_AUTOHSCROLL
+ CONTROL "&Connect Drive Letter Map Point when AFS is Connected.",
+ IDC_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,49,
+ 102,185,10
+ PUSHBUTTON "Cancel",IDCANCEL,245,122,50,14
+ PUSHBUTTON "OK",IDOK,179,123,58,14
+ COMBOBOX IDC_DRIVE,70,47,35,58,CBS_DROPDOWNLIST | CBS_SORT |
+ CBS_UPPERCASE | WS_VSCROLL | WS_TABSTOP
+ LTEXT "* Drive is currently active",IDC_STATIC,114,50,91,8
+ PUSHBUTTON "Help",IDC_HELPMAIN,245,102,50,14
+END
+
+IDD_DIALOGTERM DIALOG DISCARDABLE 0, 0, 189, 62
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
+CAPTION "AFS File Service - Warning"
+FONT 8, "MS Sans Serif"
+BEGIN
+ CTEXT "Previous AFS service was not properly terminated.\nClean up in progress\nPlease Wait.",
+ IDC_STATIC,7,17,175,36
+END
+
+IDD_DIALOGFORCE DIALOG DISCARDABLE 0, 0, 216, 110
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "AFS File Service"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "Force",IDOK,7,89,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,159,89,50,14
+ CTEXT "Static",IDC_STATICMSG,7,13,202,23,SS_CENTERIMAGE
+ LTEXT "You may select 'Force' to disconnect the drive or select 'Cancel' to bypass the operation.\n\n If you select 'Force', you risk loosing data on any open file located on the connected Drive Letter.",
+ IDC_STATIC,7,42,202,44
+END
+
+IDD_DIALOGRETRY DIALOG DISCARDABLE 0, 0, 198, 116
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Dialog"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "Retry",IDOK,7,95,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,73,95,50,14
+ CTEXT "Static",IDC_STATICMSG,7,13,181,23,SS_CENTERIMAGE
+ LTEXT "You should shut down any applications that are using the Mapped Drive Letter and then press Retry. Or press Cancel to the skip the disconnect.\n\nYou can Force disconnect; however, you may risk losing file data on any open file.",
+ IDC_STATICOPTIONS,7,37,181,52
+ PUSHBUTTON "Force",IDC_FORCE,141,95,50,14
+END
+
+IDD_PROGBAR_DIALOG DIALOG DISCARDABLE 0, 0, 179, 70
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP
+FONT 8, "MS Sans Serif"
+BEGIN
+ RTEXT "backgroung time",IDC_TIMEBACKGROUND,6,14,36,8,NOT
+ WS_GROUP
+ RTEXT "Authtime",IDC_TIMEAUTHENICATION,6,28,36,8,NOT WS_GROUP
+ RTEXT "mounttime",IDC_TIMEMOUNT,6,44,36,8,NOT WS_GROUP
+ CTEXT "",IDC_COMPLETE_AUTH,45,29,12,8,NOT WS_VISIBLE |
+ WS_BORDER
+ CTEXT "",IDC_COMPLETE_ENABLE,45,15,12,8,NOT WS_VISIBLE |
+ WS_BORDER
+ CTEXT "",IDC_COMPLETE_MOUNT,45,44,12,8,NOT WS_VISIBLE |
+ WS_BORDER
+ GROUPBOX "",IDC_STATUSREGION,44,7,16,51,NOT WS_VISIBLE
+ LTEXT "Enable AFS Client Console",IDC_CHECKBACKGROUND,61,15,
+ 111,8
+ LTEXT "Authenication",IDC_CHECKAUTHENICATION,61,29,111,8
+ LTEXT "Connect Drive Letter Map Points",IDC_CHECKMOUNT,61,43,
+ 111,12
+END
+
+IDD_MENUSETTINGS DIALOG DISCARDABLE 0, 0, 269, 104
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
+CAPTION "AFS Settings"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,212,83,50,14
+ LTEXT "Advanced System Menus are enabled.\nRight click System Menu located on the Title bar of the main dialog box.\n\nFrom this menu you capture AFS events to a window or to a file (AFSCLI.LOG).\nYou can also choose to view the (DOS based) AFS Client Console.",
+ IDC_STATIC,7,14,255,40
+ LTEXT "Do not attempt to log off windows (or reboot) while the AFS Client Console visable!",
+ IDC_STATIC,7,61,255,22
+END
+
+IDD_SETTINGS DIALOGEX 0, 0, 187, 161
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "AFS Option Settings"
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "Accept",IDOK,130,7,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,130,24,50,14
+ CONTROL "Log to File",IDC_LOGTOFILE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,17,24,47,10
+ CTEXT "Command Line Loading Options",IDC_STATIC,7,7,116,14,
+ SS_CENTERIMAGE
+ CONTROL "Log to Window",IDC_LOGTOWINDOW,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,17,36,60,10
+ CONTROL "Connect on Start",IDC_CONNECTONSTART,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,17,48,65,10
+ EDITTEXT IDC_USERNAME,47,65,51,14,ES_READONLY | NOT WS_BORDER |
+ NOT WS_TABSTOP,WS_EX_STATICEDGE
+ RTEXT "Username:",IDC_STATIC,7,65,39,8
+ PUSHBUTTON "Help",IDH_SETTINGS,130,43,50,14
+ EDITTEXT IDC_MAXLOGINTIME,148,98,31,14,ES_AUTOHSCROLL | ES_NUMBER
+ RTEXT "Max Time - Enable Client Console (Sec.)",IDC_STATIC,19,
+ 99,127,11,0,0,HIDC_STATIC
+ EDITTEXT IDC_POWERRESTARTDELAY,149,116,31,14,ES_AUTOHSCROLL |
+ ES_NUMBER
+ RTEXT "Power Restart Delay (Sec.)",IDC_STATIC,62,118,84,8,0,0,
+ HIDC_STATIC
+ GROUPBOX "",IDC_OPTIONLINE,7,81,173,9,NOT WS_VISIBLE
+ CONTROL "Advanced Settings",IDC_CHECKADVANCED,"Button",
+ BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,107,66,73,10
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 2,0,0,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "WinAfsLoad MFC Application\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "WinAfsLoad\0"
+ VALUE "LegalCopyright", "Copyright (C) 2000\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "WinAfsLoad.EXE\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "WinAfsLoad Application\0"
+ VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_ABOUTBOX, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 228
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 48
+ END
+
+ IDD_WINAFSLOAD_DIALOG, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 273
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 208
+ END
+
+ IDD_ACTIVITYLOG, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 249
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 126
+ END
+
+ IDD_AFSCHANGE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 295
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 140
+ END
+
+ IDD_DIALOGTERM, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 182
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 55
+ END
+
+ IDD_DIALOGFORCE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 209
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 103
+ END
+
+ IDD_DIALOGRETRY, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 191
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 109
+ END
+
+ IDD_PROGBAR_DIALOG, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 172
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 63
+ END
+
+ IDD_MENUSETTINGS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 262
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 97
+ END
+
+ IDD_SETTINGS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 180
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 154
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_TRAYICON MENU DISCARDABLE
+BEGIN
+ POPUP "&Tray"
+ BEGIN
+ MENUITEM "&Open", IDM_APP_OPEN
+ MENUITEM "&Connect", IDC_CONNECT
+ MENUITEM "Settings", IDC_SETTINGS
+ MENUITEM "Exit", IDC_CANCEL
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
+BEGIN
+ "S", IDC_SHOWBACK, VIRTKEY, ALT, NOINVERT
+ VK_RETURN, IDC_CONNECT, VIRTKEY, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME ICON DISCARDABLE "res\\WinAfsLoad.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_WORLD BITMAP DISCARDABLE "res\\world.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_ABOUTBOX "&About WinAFSLoad..."
+ IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDR_MAINFRAME "AFS Control Panel"
+ IDR_TRAYICON "AFS Control Panel"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDC_CONNECT "Click to Connect/Disconnect AFS Client"
+ IDC_CANCEL "Click to exit (terminate) application."
+ IDS_HIDE "Click to shrink view into a System Tray Icon. Hint right click icon to view."
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDC_DRIVEMOUNTLIST "Click Check box to Connect or Disconnect. Highlight to Change or Remove."
+ IDC_SETTINGS "Click to change load and log options."
+ IDC_CHECKADVANCED "Click to show AFS Drive Letter Map Points."
+ IDC_USERNAME "Enter Username"
+ IDC_PASSWORD "Enter Password"
+ IDC_SAVEUSERNAME "Click to remember password on connect or when you choose exit."
+ IDC_SHOWLOG "Click to show the AFS Client Console."
+ IDC_ADD "Click to add a new AFS Drive Letter Map Point."
+ IDC_CHANGE "Click to change a highlighted Drive Letter Cell Map Point"
+ IDC_REMOVE "Click to remove all highlighted Drive Letter Map Points"
+ IDS_DISCONNECT "Click to Disconnect AFS Client (Disconnect all AFS Drive Letter Maps)"
+ IDS_HIDEADVANCE "Click to hide AFS Drive Letter Map Points."
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_HIDELOG "Click to hide the AFS Client Console."
+ IDS_FORGETUSERNAME "Click to forget password on connect or when you choose exit."
+ IDC_AUTH "Click to re-authenicate (reset expiratoin token)."
+ IDC_SHOWBACK "Use Alt+S to show background"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDM_VIEWAFS "View AFS Client (toggle)"
+ IDH_ADD "HELP ADD"
+ IDH_CHANGE "Help Change"
+ IDH_MAIN "Help Main"
+ IDM_CLEAR "Clear Window"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDM_CAPTUREWINDOW "Capture Events to windows"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDM_CAPTUREFILE "Capture Events to file (AFSCLI.LOG)"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDM_EXPLORERAFS "Explorer AFS Menu."
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "afxres.rc" // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
--- /dev/null
+// WinAfsLoadDlg.cpp : implementation file
+//
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#include "stdafx.h"
+#include "WinAfsLoad.h"
+#include "WinAfsLoadDlg.h"
+#include "modver.h"
+#include "encript.h"
+#include <winreg.h>
+#include "change.h"
+#include "cregkey.h"
+#include "force.h"
+#include "retry.h"
+#include <Lmcons.h>
+#include "settings.h"
+#include "afsmsg95.h"
+#include "ProgBarDlg.h"
+#include "MyFrame.h"
+#include "commandsettings.h"
+//#include <process.h>
+
+#define PASSWORDSIZE 32
+#define USERNAMESIZE 32
+#define SHARENAMESIZE 12
+#define MAXSHARES 10
+#define DRIVESIZE 3
+#define AUTOSIZE 1
+#define ITEMCHECKED 0x2000 //CONTROL List defined for checked and not checked condition
+#define ITEMNOTCHECKED 0x1000
+#define TIMEINTERVAL 200
+#define CHECKDIR 2500 //NUMBER CYCLE before checking directory for changes (2.5 seconds)
+#define MAXWORLDINDEX 25 //Number of frames (-1) in the whirling world
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+ CAboutDlg();
+
+// Dialog Data
+ //{{AFX_DATA(CAboutDlg)
+ enum { IDD = IDD_ABOUTBOX };
+ CString m_sVersion;
+ //}}AFX_DATA
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CAboutDlg)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ //{{AFX_MSG(CAboutDlg)
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+ //{{AFX_DATA_INIT(CAboutDlg)
+ m_sVersion = _T("");
+ //}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CAboutDlg)
+ DDX_Text(pDX, IDC_STATICABOUT, m_sVersion);
+ //}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+ //{{AFX_MSG_MAP(CAboutDlg)
+ // No message handlers
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+class CCancel
+{
+ BOOL *m_pPtr;
+ BOOL m_bVal;
+public:
+ CCancel(BOOL &sav,BOOL val){m_pPtr=&sav;m_bVal=val;}
+ ~CCancel(){
+ *m_pPtr=m_bVal;
+ }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinAfsLoadDlg dialog
+
+CWinAfsLoadDlg::CWinAfsLoadDlg(const char *user,const char *pass,CWnd* pParent /*=NULL*/)
+ : CDialog(CWinAfsLoadDlg::IDD, pParent), m_trayIcon(WM_MY_TRAY_NOTIFICATION,IDR_MAINFRAME,IDR_TRAYICON)
+{
+ //{{AFX_DATA_INIT(CWinAfsLoadDlg)
+ m_sPassword = _T("");
+ m_sUsername = _T("");
+ m_sMountDisplay = _T("");
+ //}}AFX_DATA_INIT
+ // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
+ if (user)
+ m_sUsername=user;
+ if (pass)
+ m_sPassword=pass;
+ m_bConnect=CWINAFSLOADAPP->m_bConnect;
+ m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+ m_pImagelist=NULL;
+ m_iActiveItem=-1; //used in MountList to indicate which item is clicked on
+ m_nAutTimer=m_nDirTimer=0;
+ m_pEncript=NULL;
+ m_PowerResumeDelay=-1;
+// m_PowerDelay=0;
+}
+
+void CWinAfsLoadDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CWinAfsLoadDlg)
+ DDX_Control(pDX, IDC_WORLD, m_cWorld);
+ DDX_Control(pDX, IDC_AUTHWARN, m_cAuthWarn);
+ DDX_Control(pDX, IDC_AUTH, m_cAuthenicate);
+ DDX_Control(pDX, IDC_SAVEUSERNAME, m_cSaveUsername);
+ DDX_Control(pDX, IDC_DRIVEMOUNTLIST, m_cMountlist);
+ DDX_Control(pDX, IDC_CHANGE, m_cChange);
+ DDX_Control(pDX, IDC_REMOVE, m_cRemove);
+ DDX_Control(pDX, IDC_OPTIONLINE, m_cOptionLine);
+ DDX_Control(pDX, IDC_CHECKADVANCED, m_cCheckAdvanceDisplay);
+ DDX_Control(pDX, IDC_CONNECT, m_cConnect);
+ DDX_Control(pDX, IDC_CANCEL, m_cCancel);
+ DDX_Control(pDX, IDC_PASSWORD, m_cPassword);
+ DDX_Control(pDX, IDC_USERNAME, m_cUsername);
+ DDX_Text(pDX, IDC_PASSWORD, m_sPassword);
+ DDV_MaxChars(pDX, m_sPassword, 32);
+ DDX_Text(pDX, IDC_USERNAME, m_sUsername);
+ DDV_MaxChars(pDX, m_sUsername, 32);
+ DDX_Text(pDX, IDC_MOUNTDISPLAY, m_sMountDisplay);
+ //}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CWinAfsLoadDlg, CDialog)
+ //{{AFX_MSG_MAP(CWinAfsLoadDlg)
+ ON_WM_SYSCOMMAND()
+ ON_WM_PAINT()
+ ON_BN_CLICKED(IDC_CONNECT, OnConnect)
+ ON_BN_CLICKED(IDC_CHECKADVANCED, OnCheckadvanced)
+ ON_COMMAND(IDM_APP_OPEN, OnAppOpen)
+ ON_BN_CLICKED(IDC_CHANGE, OnChange)
+ ON_BN_CLICKED(IDC_ADD, OnAdd)
+ ON_BN_CLICKED(IDC_REMOVE, OnRemove)
+ ON_NOTIFY(NM_CLICK, IDC_DRIVEMOUNTLIST, OnClickDrivemountlist)
+ ON_NOTIFY(LVN_ITEMCHANGED, IDC_DRIVEMOUNTLIST, OnItemchangedDrivemountlist)
+ ON_WM_QUERYENDSESSION()
+ ON_WM_TIMER()
+ ON_BN_CLICKED(IDC_AUTH, OnAuthenicate)
+ ON_WM_DESTROY()
+ ON_WM_CTLCOLOR()
+ ON_COMMAND(IDC_SHOWBACK, OnShow)
+ ON_WM_HELPINFO()
+ ON_BN_CLICKED(IDC_HELPMAIN, OnHelpmain)
+ ON_BN_CLICKED(IDC_SETTINGS, OnSettings)
+ ON_BN_CLICKED(IDC_CANCEL, OnCancel)
+ ON_WM_SYSCOMMAND()
+ //}}AFX_MSG_MAP
+ ON_BN_CLICKED(IDM_EXPLORERAFS, OnTrayButton0)
+ ON_BN_CLICKED(IDM_EXPLORERAFS+16, OnTrayButton1)
+ ON_BN_CLICKED(IDM_EXPLORERAFS+32, OnTrayButton2)
+ ON_BN_CLICKED(IDM_EXPLORERAFS+48, OnTrayButton3)
+ ON_BN_CLICKED(IDM_EXPLORERAFS+64, OnTrayButton4)
+ ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
+ ON_MESSAGE(WM_POWERBROADCAST,OnPowerBroadcast)
+ ON_MESSAGE(WM_ERRORMSG,OnErrorMessage)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CWinAfsLoadDlg message handlers
+
+
+BOOL CWinAfsLoadDlg::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
+{
+ TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
+ UINT nID =pNMHDR->idFrom;
+ if (pTTT->uFlags & TTF_IDISHWND)
+ {
+ // idFrom is actually the HWND of the tool
+ nID = ::GetDlgCtrlID((HWND)nID);
+ switch (nID)
+ {
+ case IDC_CHECKADVANCED:
+ if (m_cCheckAdvanceDisplay.GetCheck())
+ pTTT->lpszText = MAKEINTRESOURCE(IDS_HIDEADVANCE);
+ else
+ pTTT->lpszText = MAKEINTRESOURCE(nID);
+ pTTT->hinst = AfxGetResourceHandle();
+ return(TRUE);
+
+ case IDC_SAVEUSERNAME:
+ if (m_cSaveUsername.GetCheck())
+ pTTT->lpszText = MAKEINTRESOURCE(IDS_FORGETUSERNAME);
+ else
+ pTTT->lpszText = MAKEINTRESOURCE(nID);
+ pTTT->hinst = AfxGetResourceHandle();
+ return(TRUE);
+ case IDC_CANCEL:
+ if (m_bServiceIsActive)
+ pTTT->lpszText = MAKEINTRESOURCE(IDS_HIDE);
+ else
+ pTTT->lpszText = MAKEINTRESOURCE(nID);
+ pTTT->hinst = AfxGetResourceHandle();
+ return(TRUE);
+ case IDC_CONNECT:
+ if (m_bServiceIsActive)
+ pTTT->lpszText = MAKEINTRESOURCE(IDS_DISCONNECT);
+ else
+ pTTT->lpszText = MAKEINTRESOURCE(nID);
+ pTTT->hinst = AfxGetResourceHandle();
+ return(TRUE);
+ default:
+ pTTT->lpszText = MAKEINTRESOURCE(nID);
+ pTTT->hinst = AfxGetResourceHandle();
+ return(TRUE);
+ case 0:
+ break;
+ }
+ }
+ return(FALSE);
+}
+
+BOOL CWinAfsLoadDlg::PreTranslateMessage(MSG* pMsg)
+{
+ // TODO: Add your specialized code here and/or call the base class
+ // get the accelerator table to work, i.e. press <enter> is same as IDC_CONNECT
+ if (m_hAccelTable)
+ {
+ if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
+ return(TRUE);
+ }
+ return CDialog::PreTranslateMessage(pMsg);
+}
+
+BOOL CWinAfsLoadDlg::OnInitDialog()
+{
+ DWORD rc;
+ char compName[129];
+ CString msg;
+ CDialog::OnInitDialog();
+ // Add "About..." menu item to system menu.
+
+ // IDM_ABOUTBOX must be in the system command range.
+ ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+ ASSERT(IDM_ABOUTBOX < 0xF000);
+
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu != NULL)
+ {
+ CString strMenu;
+ strMenu.LoadString(IDS_ABOUTBOX);
+ ASSERT(!strMenu.IsEmpty());
+ pSysMenu->AppendMenu(MF_SEPARATOR);
+ pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strMenu);
+ }
+ if (CWINAFSLOADAPP->m_bShowAfs)
+ OnShowAddMenus();
+ // Set the icon for this dialog. The framework does this automatically
+ // when the application's main window is not a dialog
+ SetIcon(m_hIcon, TRUE); // Set big icon
+ SetIcon(m_hIcon, FALSE); // Set small icon
+ // TODO: Add extra initialization here
+
+ m_hAccelTable = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR1));
+
+// bind to socket's DLL
+
+ DWORD uStatus;
+ WSADATA WSAData;
+ if ((uStatus = WSAStartup(MAKEWORD(1,1), &WSAData)) == 0) {
+ LOG("AFS:Startup%s",WSAData.szDescription);
+ } else {
+ msg.Format("AFS Error - Cannot find socket.dll status=0x%0x", uStatus);
+ AfxMessageBox(msg,MB_OK);
+ SendMessage(WM_CLOSE,0,0);
+ LOG("WM_CLOSE3");
+ return FALSE;
+ }
+
+ // We need to make sure the DLL's support the features provided by the CListCtrl common control
+ // That is they must be later than 4.71
+
+// ver.GetFileVersionInfo("comctl32.dll",vernum); //use this form if Win95???
+
+ DWORD vernum;
+ DLLVERSIONINFO dvi;
+ CModuleVersion ver;
+ if (!ver.DllGetVersion("comctl32.dll", dvi,vernum))
+ ver.GetFileVersionInfo("comctl32.dll",vernum);
+ LOG("comctl32 %d.%d",(vernum>>16) & 0xff,vernum & 0xff);
+ if(vernum< PACKVERSION(4,70))
+ {
+ msg.Format("Current Version %d.%d, Recommend at least version 4.70 for COMCTL32.dll, (Install, 401COMUPD.EXE or Internet Explorer 4.01 SP2 or better)",HIWORD(vernum),LOWORD(vernum));
+ MessageBox(msg, "AFS DLL Version Warning", MB_OK);
+ m_cCheckAdvanceDisplay.ModifyStyle(0,WS_DISABLED);
+ } else {
+ if (!ver.DllGetVersion("Shell32.dll", dvi,vernum))
+ ver.GetFileVersionInfo("Shell32.dll",vernum);
+ LOG("Shell32 %d.%d",(vernum>>16) & 0xff,vernum & 0xff);
+ if(vernum< PACKVERSION(4,00))
+ {
+ msg.Format("Current Version %d.%d, Recommend at least version 4.00 for SHELL32.dll, (Install Internet Explorer 4.01 SP2 or better)",HIWORD(vernum),LOWORD(vernum));
+ MessageBox(msg, "AFS DLL Version Warning", MB_OK);
+ m_cCheckAdvanceDisplay.ModifyStyle(0,WS_DISABLED);
+ }
+ }
+ if (!ver.DllGetVersion("ADVAPI32.dll", dvi,vernum))
+ ver.GetFileVersionInfo("ADVAPI32.dll",vernum);
+ LOG("ADVAPI32 %d.%d",(vernum>>16) & 0xff,vernum & 0xff);
+ m_pEncript = (CEncript *)new CEncript(this);
+
+ // initiallze AFS and setup Progress display
+ if (!m_cAfs.Init(this,msg))
+ HandleError(msg);
+
+ m_trayIcon.AddIcon(this);
+ EnableToolTips(TRUE);
+
+ m_bServiceIsActive=FALSE;
+ SetWindowText(AFSTITLE);
+
+ UpdateData(TRUE);
+
+ rc = 128; GetComputerName(compName, &rc);
+ m_sComputername=compName;
+ m_sMountDisplay.Format("Connected Drives on Computer:%s",compName);
+ m_sUsername="";
+ m_bHomepath=FALSE;
+ CRect rect;
+ GetWindowRect(&m_OriginalRect);
+ m_cOptionLine.GetWindowRect(&rect);
+ m_DialogShrink=rect.top-m_OriginalRect.top+5; //make it above the edit box
+ SetWindowPos(&wndTop,0,0,m_OriginalRect.right-m_OriginalRect.left,m_DialogShrink,SWP_NOMOVE|SWP_NOZORDER);
+ // Pull registration information out
+ CRegkey regkey("AFS\\Window");
+ UINT logintime=0;
+ DWORD size=sizeof(m_PowerResumeDelay);
+ regkey.GetBinary("PowerResumeDelay",(LPBYTE)&m_PowerResumeDelay,size);
+ if (m_PowerResumeDelay<=0) {
+ m_PowerResumeDelay=20; //seconds
+ regkey.PutBinary("PowerResumeDelay",(LPBYTE)&m_PowerResumeDelay,size);
+ }
+ CHAR pLoginName[UNLEN + 1];
+ size=UNLEN;
+ if (GetUserName(pLoginName,&size))
+ m_sLoginName=pLoginName;
+ else
+ m_sLoginName="Bozo";
+ CString sUser,sPass;
+ RegPassword(sUser,sPass,TRUE);
+ if ((m_sUsername=="") || (m_sLoginName.IsEmpty()))
+ {
+ m_sUsername=sUser;
+ }
+ if ((m_sPassword=="") || (m_sPassword.IsEmpty()))
+ {
+ m_sPassword=sPass;
+ }
+
+ if (m_sPassword.IsEmpty())
+ {
+ m_cSaveUsername.SetCheck(FALSE);
+ RegLastUser(m_sUsername,TRUE);
+ } else
+ m_cSaveUsername.SetCheck(TRUE);
+
+ // Initialize mount control list
+
+ m_pImagelist = new CImageList();
+ ASSERT(m_pImagelist != NULL); // serious allocation failure checking
+ m_pImagelist->Create(16, 16, 0, 2, 2);
+ m_cMountlist.SetImageList(m_pImagelist, LVSIL_SMALL);
+
+ m_cMountlist.GetWindowRect(&rect);
+ {// don't particullary want to keep the DC around
+ CClientDC dc(this);
+ CSize cSize=dc.GetTextExtent("*",1);
+ CSize dSize=dc.GetTextExtent("XXXXXXXXXXX",12);
+ cSize.cx+=10;
+ int r=rect.Width()-cSize.cx-dSize.cx;
+#define COLDRIVE 0
+ m_cMountlist.InsertColumn(COLDRIVE, "Drive", LVCFMT_LEFT,
+ r * 1/5, 0);
+#define COLPATH 1
+ m_cMountlist.InsertColumn(COLPATH, "Afs Path", LVCFMT_LEFT,
+ r * 4/5, 1);
+#define COLAUTO 2
+ m_cMountlist.InsertColumn(COLAUTO, "*", LVCFMT_CENTER,
+ cSize.cx, 1);
+#define COLSHARE 3
+#define NUMCOL 4
+ m_cMountlist.InsertColumn(COLSHARE, "Share Name", LVCFMT_LEFT,
+ dSize.cx, 1);
+ m_cMountlist.SetExtendedStyle(m_cMountlist.GetExtendedStyle() | LVS_EX_FULLROWSELECT|LVS_EX_CHECKBOXES );
+ }
+ ProfileData(FALSE);
+ UpdateData(FALSE);
+ DismountAll(msg,3);
+ BuildDriveList(TRUE);
+ m_seqIndex=0;
+ m_seqCount=0; //set up sequence timer for moving world
+ m_nShown=0;
+ m_cAuthWarn.ShowWindow(SW_HIDE);
+ m_bkBrush.CreateSolidBrush(RGB(255,255,0));
+
+// WHIRLING world display
+ m_cWorld.SetWindowPos(NULL,0,0,42,42,SWP_NOMOVE|SWP_NOZORDER);
+ m_cWorld.GetWindowRect(&m_WorldRect);
+ ScreenToClient(&m_WorldRect);
+ VERIFY( m_bmpWorld.LoadBitmap( IDB_WORLD ) );
+
+ m_seqCount=0;
+ m_seqIndex=0;
+ m_dirCount=0;
+ m_nDirTimer=SetTimer(WM_DIRTIMER,TIMEINTERVAL,0);
+#ifdef _DEBUG
+ m_nAutTimer=SetTimer(WM_AUTTIMER,10000,0);
+#else
+ m_nAutTimer=SetTimer(WM_AUTTIMER,60000,0);
+#endif
+ m_bRestartAFSD=FALSE;
+ m_OSVersion.dwOSVersionInfoSize=sizeof(m_OSVersion);
+ GetVersionEx(&m_OSVersion); //get OS type & version
+ if (m_bConnect)
+ PostMessage(WM_COMMAND,IDC_CONNECT,0);
+ else
+ GotoDlgCtrl(&m_cConnect);
+ return FALSE;
+ // return TRUE unless you set the focus to a control
+} // end OnInitDialog
+
+BOOL CWinAfsLoadDlg::RegPassword(CString &user,CString &pass,BOOL fetch)
+{
+ DWORD len;
+ char *pBuffer;
+ CString sKey;
+ sKey.Format("AFS\\Security\\%s",m_sLoginName);
+ CRegkey regkey(sKey);
+ if (regkey.Getkey()==0) return FALSE;
+ if (fetch)
+ {
+ regkey.GetString("UserName",user,USERNAMESIZE);
+ if (user.IsEmpty()||(user==""))
+ {
+ return TRUE;
+ }
+ len=PASSWORDSIZE;
+ pBuffer=new char[(int)len+1];
+ regkey.GetBinary("Password",(LPBYTE)pBuffer,len);
+ if (len==0)
+ return TRUE;
+ if (m_pEncript)
+ m_pEncript->Encript(m_sComputername,m_sLoginName,user
+ ,(UCHAR *)pBuffer,len,FALSE);
+ pBuffer[(int)len]=0;
+ pass=pBuffer;
+ delete(pBuffer);
+ } else {
+ if (user.IsEmpty()||pass.IsEmpty()) {
+ regkey.PutString("UserName",user);
+ regkey.PutBinary("Password",NULL,0);
+ return TRUE;
+ }
+ if (regkey.PutString("UserName",user))
+ {
+ len=pass.GetLength();
+ pBuffer=new char[(int)len+1];
+ strcpy(pBuffer,pass);
+ if (m_pEncript)
+ m_pEncript->Encript(m_sComputername,m_sLoginName,user
+ ,(UCHAR *)pBuffer,len,TRUE);
+ else
+ len=strlen(pBuffer);
+ regkey.PutBinary("Password",(LPBYTE)pBuffer,len);
+ delete(pBuffer);
+ }
+ }
+ return TRUE;
+}
+
+BOOL CWinAfsLoadDlg::RegLastUser(CString &user,BOOL fetch)
+{
+ CString sKey;
+ sKey.Format("AFS\\Security\\%s",m_sLoginName);
+ CRegkey regkey(sKey);
+ if (regkey.Getkey()==0) return FALSE;
+ if (fetch)
+ {
+ regkey.GetString("LastUser",user,USERNAMESIZE);
+ return TRUE;
+ }
+ return (regkey.PutString("LastUser",user));
+}
+
+// MOdify the system menu
+/// need to add items to Icon Menu also
+/// check out sc_close for close postion rather than depend on fixed position
+/// Need to add Menu Item aphbetical to drive letter
+
+#define NUMOFMENUDRIVES 5
+#define INSERTPOSITION 6
+
+void CWinAfsLoadDlg::AddMenu(const char *sDrive,const char *share)
+{
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu == NULL) return;
+ CString msg;
+ msg.Format("%s %s",sDrive,share);
+ UINT id=pSysMenu->GetMenuItemID(INSERTPOSITION); //insert before About Menu Item
+ if (id==IDM_EXPLORERAFS)
+ {
+ char lpString[3];
+// limit number of drives added to is NUMOFDRIVES
+ int i=INSERTPOSITION;
+ do {
+ int len=pSysMenu->GetMenuString(i,lpString,2,MF_BYPOSITION);
+ if (*sDrive==*lpString) return;
+ UINT nID=pSysMenu->GetMenuItemID(++i);
+ if ((nID<IDM_EXPLORERAFS) || (nID>IDM_EXPLORERAFS+16*(NUMOFMENUDRIVES-1)))//NOT a Drive ITEM
+ {
+ pSysMenu->InsertMenu(i,MF_BYPOSITION,IDM_EXPLORERAFS+16*(i-INSERTPOSITION),msg);
+ MENUBLOCK blk(IDM_EXPLORERAFS+16*(i-INSERTPOSITION),msg);
+ m_trayIcon.AddDrive(blk);
+ return;
+ }
+ } while (i<INSERTPOSITION+NUMOFMENUDRIVES-1);
+ } else {
+ id=IDM_ABOUTBOX;
+ MENUBLOCK blk(IDM_EXPLORERAFS,msg);
+ m_trayIcon.AddDrive(blk);
+ if (!pSysMenu->InsertMenu(INSERTPOSITION,MF_BYPOSITION,MF_SEPARATOR)) return;
+ if (!pSysMenu->InsertMenu(INSERTPOSITION,MF_BYPOSITION,IDM_EXPLORERAFS,msg)) return;
+ }
+ return;
+}
+
+void CWinAfsLoadDlg::RemoveMenu(const char *sDrive)
+{
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu == NULL) return;
+ UINT nID=pSysMenu->GetMenuItemID(INSERTPOSITION);
+ if ((nID<IDM_EXPLORERAFS)||(nID>IDM_EXPLORERAFS+16*NUMOFMENUDRIVES)) return;
+ char lpString[3];
+ for (int i=INSERTPOSITION;i<=INSERTPOSITION+NUMOFMENUDRIVES-1;i++)
+ {
+ int len=pSysMenu->GetMenuString(i,lpString,2,MF_BYPOSITION);
+ if (*sDrive==*lpString)
+ {
+ MENUBLOCK blk;
+ blk.title=sDrive;
+ blk.mID=pSysMenu->GetMenuItemID(i);
+ m_trayIcon.RemoveDrive(blk);
+ if (!pSysMenu->RemoveMenu(i,MF_BYPOSITION )) return;
+ if ((i==INSERTPOSITION)&& (pSysMenu->GetMenuItemID(i)==MF_SEPARATOR))
+ pSysMenu->RemoveMenu(i,MF_BYPOSITION);
+ return;
+ }
+ }
+/// scan rest of list to see if you need to add a drive
+ return;
+}
+void CWinAfsLoadDlg::OnSysCommand(UINT nID, LPARAM lParam)
+{
+ switch (nID & 0xFFF0)
+ {
+ case IDM_VIEWAFS:
+ {
+ HWND hwnd=m_cAfs.GetLoadWindowHandle();
+ if (hwnd==NULL) break;
+ UINT show=(::IsWindowVisible(hwnd))?SW_HIDE:SW_SHOWNORMAL;
+ ::ShowWindow(m_cAfs.GetLoadWindowHandle(),show);
+ }
+ break;
+ case IDM_CAPTUREWINDOW:
+ CWINAFSLOADAPP->m_bLogWindow=TRUE;
+ CWINAFSLOADAPP->ShowLog(TRUE);
+ break;
+ case IDM_CAPTUREFILE:
+ CWINAFSLOADAPP->m_bLog=TRUE;
+ CWINAFSLOADAPP->ShowPrint(TRUE);
+ break;
+ case IDM_ABOUTBOX:
+ {
+ CAboutDlg dlgAbout;
+ // Lets update About box to include version information
+ char wdir[MAX_PATH];
+#ifdef _DEBUG
+ wsprintf(wdir,"%s.exe",((CWinAfsLoadApp *)AfxGetApp())->m_pszExeName);
+#else
+ wsprintf(wdir,"%s.exe",CWINAFSLOADAPP->m_pszExeName);
+#endif
+ DWORD wHandle;
+ DWORD rc;
+ rc =GetFileVersionInfoSize(wdir,&wHandle);
+ if (rc>0)
+ {
+ BYTE *lpData=(BYTE *)new BYTE[rc];
+ if (GetFileVersionInfo(wdir,wHandle,rc,lpData))
+ {
+ VS_FIXEDFILEINFO *pver;
+ UINT len;
+ if (VerQueryValue(lpData,"\\",(PVOID *)&pver,&len))
+ {
+ dlgAbout.m_sVersion.Format("WinAFSload Version %d.%d.%d",(pver->dwProductVersionMS>>16) &0xff ,pver->dwProductVersionMS & 0xff,(pver->dwProductVersionLS>>16) &0xff );
+ }
+ }
+ delete lpData;
+ }
+ dlgAbout.DoModal();
+ }
+ case SC_ICON:
+ if (GetFocus())
+ m_trayIcon.MinimiseToTray(this); //only if click on miminization botton i
+ else
+ CDialog::OnSysCommand(nID, lParam); //do this to mimic the normal windows behavor
+ break;
+
+ default:
+ if ((nID>=IDM_EXPLORERAFS)&&(nID<=IDM_EXPLORERAFS+16*NUMOFMENUDRIVES))
+ {
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu == NULL) return;
+ CString msg;
+ char sDrive[3];
+ pSysMenu->GetMenuString(nID,sDrive,3,MF_BYCOMMAND);
+ if (!m_cAfs.StartExployer(msg,sDrive))
+ HandleError(msg);
+ break;
+ }
+ CDialog::OnSysCommand(nID, lParam);
+ break;
+ }
+}
+
+// If you add a minimize button to your dialog, you will need the code below
+// to draw the icon. For MFC applications using the document/view model,
+// this is automatically done for you by the framework.
+
+void CWinAfsLoadDlg::OnPaint()
+{
+ CPaintDC dc(this); // device context for painting
+ if (IsIconic())
+ {
+ SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+
+ // Center icon in client rectangle
+ int cxIcon = GetSystemMetrics(SM_CXICON);
+ int cyIcon = GetSystemMetrics(SM_CYICON);
+ CRect rect;
+ GetClientRect(&rect);
+ int x = (rect.Width() - cxIcon + 1) / 2;
+ int y = (rect.Height() - cyIcon + 1) / 2;
+
+ // Draw the icon
+ dc.DrawIcon(x, y, m_hIcon);
+ }
+ else
+ {
+ m_bmpWorld.DrawTrans(dc,m_WorldRect,(m_WorldRect.Width()-1)*m_seqIndex);
+ }
+}
+
+
+void CWinAfsLoadDlg::HandleError(const char *s,BOOL display)
+{
+ LOG(s);
+ UpdateData(FALSE);
+ if (display)
+ {
+ m_cAfs.FinishProgress();
+ CWait wait(IDC_ARROW);
+ MessageBox(s,"AFS Client Warning",MB_ICONWARNING | MB_OK);
+ }
+}
+
+
+void CWinAfsLoadDlg::OnConnect()
+{
+// This is required to keep a process from getting inbehind the error display dialog box and hitting the Connect Button again.
+// the best way to avoid this would have been to separate GUI task from processes; that way
+// the Connect button would have bee disabled while the process is busy or if waiting for an error response! It is possible
+// to send a ClickMessage to the Connect button even with the a modal dialog box overlaying the main dialog!
+
+ if (CWait::IsBusy()) return;
+ CString msg;
+ CWait wait;
+ m_iActiveItem=-1; //necessary to indicate to MountList that items being changed are done by program not by mouse input
+ UpdateData(TRUE);
+ if (m_bServiceIsActive) // DOS is active so lets terminate
+ {
+ // disconnect any connected AFS mounts, unless there are files open!
+ if (!DismountAll(msg,0))
+ return;
+ TerminateBackground();
+ m_nShown=0;
+ m_cAuthWarn.ShowWindow(SW_HIDE);
+ return;
+ }
+ CCancel cancel(m_bConnect,FALSE); //clear m_bConnect when connection done
+ if (m_sUsername.IsEmpty() || m_sPassword.IsEmpty())
+ {
+ HandleError("You must enter a username and password!");
+ if (m_sUsername.IsEmpty()) m_cUsername.SetFocus();
+ else m_cPassword.SetFocus();
+ return;
+ }
+ CProgress progress(this,7);
+ progress.Next();
+ if (!m_cAfs.Create(msg,m_sComputername,m_procInfo))
+ {
+ HandleError(msg);
+ m_procInfo.hThread=0;
+ return;
+ }
+ // CWINAFSLOADAPP->m_sMsg contains the host name used for login
+ LOG("AFS Client Console started successfully [%s].",(const char *)m_sComputername);
+ CString sDrive;
+ // lets find the All
+ CString sKey;
+ for (int iItem=0;iItem<m_cMountlist.GetItemCount();iItem++)
+ {
+ sKey = m_cMountlist.GetItemText(iItem,COLSHARE);
+ if (stricmp(sKey,"all")!=0) continue;
+ CString sAuto(m_cMountlist.GetItemText(iItem,COLAUTO));
+ if (sAuto!="*")
+ continue;
+ sDrive=m_cMountlist.GetItemText(iItem,COLDRIVE);
+ LOG("Connect %s %s",sDrive,sKey);
+ if (m_cAfs.Mount(msg,sDrive,sKey))
+ {
+ m_cMountlist.SetCheck(iItem,TRUE);
+ AddMenu(sDrive,sKey);
+ } else {
+ CString msg2;
+ m_cAfs.Shutdown(msg2);
+ m_procInfo.hThread=0;
+ msg2.Format("Connect can't continue: %s",msg);
+ HandleError(msg2);
+ return;
+ }
+ break;
+ }
+ if (stricmp(sKey,"all")!=0){
+ m_cAfs.Shutdown(msg);
+ m_procInfo.hThread=0;
+ msg="Connect can't continue, 'all' path not defined";
+ HandleError(msg);
+ return;
+ }
+ progress.Next();
+ if (!m_cAfs.Authencate(msg,m_sUsername,m_sPassword))
+ {
+ CString msg2;
+ m_cAfs.Dismount(msg2,sDrive,TRUE);
+ m_cMountlist.SetCheck(iItem,FALSE);
+ RemoveMenu(sDrive);
+ m_cAfs.Shutdown(msg2);
+ m_procInfo.hThread=0;
+ HandleError(msg);
+ return;
+ }
+ progress.Next();
+ // scan through the list for any additional items to connect
+ BuildDriveList();
+ for (iItem=0;iItem<m_cMountlist.GetItemCount();iItem++)
+ {
+ CString sKey(m_cMountlist.GetItemText(iItem,COLSHARE));
+ if (stricmp(sKey,"all")==0) continue;
+ CString sAuto(m_cMountlist.GetItemText(iItem,COLAUTO));
+ if (sAuto!="*")
+ continue;
+ sDrive=m_cMountlist.GetItemText(iItem,COLDRIVE);
+ LOG("Connect %s %s",sDrive,sKey);
+ if (m_cAfs.Mount(msg,sDrive,sKey))
+ {
+ m_cMountlist.SetCheck(iItem,TRUE);
+ AddMenu(sDrive,sKey);
+ } else
+ HandleError(msg);
+ }
+ if (!m_cAfs.StartExployer(msg,sDrive))
+ HandleError(msg);
+ if (!m_cSaveUsername.GetCheck())
+ {
+ m_sPassword.Empty();
+ UpdateData(FALSE);
+ }
+// Sleep(5000)
+ m_bServiceIsActive=TRUE; //DON'T allow shutdown until DOS is terminated
+ UpdateConnect();
+ if (m_bConnect)
+ PostMessage(WM_COMMAND,IDC_CANCEL,0);
+}
+
+void CWinAfsLoadDlg::PostNcDestroy()
+{
+ // TODO: Add your specialized code here and/or call the base class
+ WSACleanup();
+ if( m_pImagelist != NULL)
+ delete m_pImagelist;
+ if (m_pEncript)
+ delete m_pEncript;
+ m_bmpWorld.DeleteObject();
+ CDialog::PostNcDestroy();
+}
+
+
+void CWinAfsLoadDlg::OnCancel()
+{
+ // TODO: Add your control notification handler code here
+
+ if (m_bServiceIsActive)
+ ShowWindow(SW_HIDE);
+ else
+ {
+ CString msg,warn="";
+ ProfileData(TRUE);
+ CString user,pass;
+ UpdateData(TRUE);
+ RegPassword(user,pass,TRUE);
+ if (m_cSaveUsername.GetCheck())
+ {
+ if (!m_pEncript->IsValid())
+ warn="\n\nAt this time if you choose to save your password on your harddrive, it will not be in encripted form.\n\n\
+To encript your password you must have version 4.71 of ADVAPI32.dll (or better).\n Note: To upgrade this system file, install Internet Explorer 4.01 SP2 (or better).\n\n\
+HINT:To intstall Internet Explorer 4.01 Service Pack 2\n\
+1. Insert the CD that contains Service Pack 2\n\
+2. Use the Explorer to navigate to the CDROM sub-Directory \\IE4SP2\\I386\n\
+3. Double Click on Setup \n\
+4. Follow the instructions for standard Installation\n\
+5. If asked, select option to install Windows Desktop Update\n\
+6. You will have to restart your computer when installation is completed\n\
+7. You may remove all other components except SP2 (approximatly 90MB)";
+ if ((user==m_sUsername) && (m_sPassword!=pass))
+ {
+ msg.Format("Your password is different from what was previous saved on disk.\n Do you wish to update? %s",warn);
+ if (MessageBox(msg
+ ,"AFS - Security Warning"
+ , MB_ICONWARNING | MB_YESNO)==IDYES)
+ RegPassword(m_sUsername,m_sPassword,FALSE);
+ } else if (user==""){
+ if (m_pEncript)
+ msg.Format("Your user name and password (encrypted) will be saved on your disk.\n Do you wish to save?");
+ else
+ msg.Format("Your user name and password will be saved on your disk.\n Do you wish to save?%s",warn);
+ if (MessageBox(msg,"AFS - Security Warning"
+ , MB_ICONWARNING | MB_YESNO)==IDYES)
+ RegPassword(m_sUsername,m_sPassword,FALSE);
+ } else if (user!=m_sUsername){
+ msg.Format("Previous saved on the disk a user name (%s) and password will be overwritten by new user name (%s) and password(encrypted). Do you wish to update?%s",user,m_sUsername,warn);
+ if (MessageBox(msg,"AFS - Security Warning"
+ , MB_ICONWARNING | MB_YESNO)==IDYES)
+ RegPassword(m_sUsername,m_sPassword,FALSE);
+ }
+ }
+ else
+ {
+ if ((pass!="")&&(user==m_sUsername))
+ {
+ msg.Format("Previous user name (%s) and password will be removed from the disk\nDo you wish to clear?",user);
+ if (MessageBox(msg,"AFS - Security Warning",
+ MB_ICONWARNING | MB_YESNO)==IDYES)
+ {
+ user="";
+ RegPassword(user,user,FALSE);
+ }
+ }
+ }
+ RegLastUser(m_sUsername,FALSE);
+ CDialog::OnCancel();
+ }
+}
+
+void CWinAfsLoadDlg::OnCheckadvanced()
+{
+ // TODO: Add your control notification handler code here
+ if (m_cCheckAdvanceDisplay.GetCheck())
+ {
+ CWait wait;
+ if (m_bServiceIsActive)
+ UpdateMountDisplay();
+ SetWindowPos(&wndTop,0,0,m_OriginalRect.right-m_OriginalRect.left,m_OriginalRect.bottom-m_OriginalRect.top,SWP_NOMOVE|SWP_NOZORDER);
+ } else {
+ SetWindowPos(&wndTop,0,0,m_OriginalRect.right-m_OriginalRect.left,m_DialogShrink,SWP_NOMOVE|SWP_NOZORDER);
+ }
+}
+
+BOOL CWinAfsLoadDlg::DismountAll(CString &msg,INT mode)
+{// mode =0 , give user option to retry or cancel
+ //mode =1, give user option to force
+ //mode =3 , force it anyway
+ TCHAR szDrive[] = TEXT("*:");
+ TCHAR szMapping[ MAX_PATH ] = TEXT("");
+ LPTSTR pszSubmount = szMapping;
+ DWORD dwSize = MAX_PATH;
+ TCHAR pBuffer[MAX_PATH];
+ if (strlen(m_cAfs.MountName())==0)
+ return TRUE;
+ for (TCHAR chDrive = 'D'; chDrive <= 'Z'; ++chDrive)
+ {
+ szDrive[0]=chDrive;
+ if (WNetGetConnection (szDrive, szMapping, &dwSize) == NO_ERROR)
+ {
+ CHAR *p=strstr(szMapping,m_cAfs.MountName());
+ if (p)
+ {
+ LOG("Disconnect %s %s",szDrive,szMapping);
+ if (!m_cAfs.Dismount(msg,szDrive,(mode==3)))
+ {
+ CWait wait;
+ switch (mode)
+ {
+ case 1: //Option to force
+ {
+ CForce dlg;
+ dlg.m_sMsg=msg;
+ switch (dlg.DoModal())
+ {
+ case IDOK:
+ LOG("Force Disconnect %s %s",szDrive,szMapping);
+ if (!m_cAfs.Dismount(msg,szDrive,TRUE))
+ return FALSE;
+ break;
+ default:
+ return FALSE;
+ }
+ }
+ break;
+ default:
+ {//option to return
+ CRetry dlg(TRUE);
+ dlg.m_sMsg=msg;
+ switch (dlg.DoModal())
+ {
+ case IDC_FORCE:
+ LOG("Force Disconnect %s %s",szDrive,szMapping);
+ if (!m_cAfs.Dismount(msg,szDrive,TRUE))
+ return FALSE;
+ break;
+ case IDOK:
+ chDrive--;
+ continue;
+
+ default:
+ return FALSE;
+ }
+ }
+ }
+ }
+ p=strrchr(szMapping,'\\');
+ if (p)
+ for (int iItem=m_cMountlist.GetItemCount()-1;iItem>=0;iItem--)
+ {
+ m_cMountlist.GetItemText(iItem,COLSHARE,pBuffer,MAX_PATH);
+ if (stricmp(p+1,pBuffer)!=0) continue;
+ m_cMountlist.GetItemText(iItem,COLDRIVE,pBuffer,MAX_PATH);
+ if (stricmp(szDrive,pBuffer)!=0) continue;
+ m_cMountlist.SetCheck(iItem,FALSE);
+ RemoveMenu(szDrive);
+ break;
+ }
+ }
+ }
+ }
+ return TRUE;
+}
+
+BOOL CWinAfsLoadDlg::TerminateBackground(BOOL bDisplay,CString *emsg)
+{// if bDisplay==FALSE then skip error message and don't update connect buttons (power down needs this option)
+// IF error and emsg!=NULL then return error messaage
+ CString msg;
+ CWait wait;
+ if (!m_cAfs.Shutdown(msg))
+ {
+ HandleError(msg,bDisplay);
+ m_cConnect.ModifyStyle(0,WS_DISABLED,0);
+ m_cConnect.Invalidate();
+ m_cCancel.SetWindowText("Exit");
+ m_cCancel.Invalidate();
+ m_trayIcon.SetConnectState(2);
+ m_bServiceIsActive=FALSE;
+ if (emsg)
+ *emsg=msg;
+ return FALSE;
+ }
+ m_bServiceIsActive=FALSE;
+ if (bDisplay)
+ UpdateConnect();
+ LOG("AFS Client Console stopped");
+ return TRUE;
+}
+
+void CWinAfsLoadDlg::UpdateConnect()
+{
+ if (m_bRestartAFSD)
+ {
+ m_cConnect.ModifyStyle(WS_DISABLED,0);
+ m_cAuthenicate.ModifyStyle(WS_DISABLED,0);
+ return;
+ }
+ if (m_bServiceIsActive)
+ {
+ m_cConnect.SetWindowText("DisConnect");
+ m_cConnect.Invalidate();
+ m_cCancel.SetWindowText("Cancel");
+ m_cCancel.Invalidate();
+ m_cAuthenicate.ModifyStyle(WS_DISABLED,0);
+ m_cAuthenicate.Invalidate();
+ m_trayIcon.SetConnectState(0);
+ return;
+ }
+ m_cConnect.SetWindowText("Connect");
+ m_cConnect.Invalidate();
+ m_cCancel.SetWindowText("Exit");
+ m_cCancel.Invalidate();
+ m_cAuthenicate.ModifyStyle(0,WS_DISABLED);
+ m_cAuthenicate.Invalidate();
+ m_trayIcon.SetConnectState(1);
+}
+
+
+void CWinAfsLoadDlg::OnAppOpen()
+{
+ // TODO: Add your command handler code here
+ //required so when icon menu is "Open" it will show the hidden application
+ m_trayIcon.MaximiseFromTray(this);
+// ShowWindow(SW_SHOW);
+}
+
+// Up to 4 drives can be listed on the menu for the user to click on and start up explorer
+void CWinAfsLoadDlg::OnTrayButton0()
+{
+ OnSysCommand(IDM_EXPLORERAFS, 0);
+}
+void CWinAfsLoadDlg::OnTrayButton1()
+{
+ OnSysCommand(IDM_EXPLORERAFS+16, 0);
+}
+void CWinAfsLoadDlg::OnTrayButton2()
+{
+ OnSysCommand(IDM_EXPLORERAFS+32, 0);
+}
+void CWinAfsLoadDlg::OnTrayButton3()
+{
+ OnSysCommand(IDM_EXPLORERAFS+48, 0);
+}
+void CWinAfsLoadDlg::OnTrayButton4()
+{
+ OnSysCommand(IDM_EXPLORERAFS+64, 0);
+}
+
+#define MAXKEY (SHARENAMESIZE+1)*MAXSHARES
+BOOL CWinAfsLoadDlg::ProfileData(BOOL put)
+{
+ CString dINI;
+ CString tINI;
+ dINI.Format("%safsdsbmd.ini",CWINAFSLOADAPP->m_sTargetDir);
+ tINI.Format("%safsdsbmt.ini",CWINAFSLOADAPP->m_sTargetDir);
+ BOOL ret=TRUE;
+ if (put)
+ {
+#define BLOCKSIZE MAX_PATH+SHARENAMESIZE+3
+ int scur=BLOCKSIZE;
+ char *sblock=(char *)malloc(scur);
+ int sused=0;
+ char *sptr=sblock;
+ int dcur=128;
+ char *dblock=(char *)malloc(dcur);
+ int dused=0;
+ char *dptr=dblock;
+ for (int iItem=m_cMountlist.GetItemCount()-1;iItem>=0;iItem--)
+ {
+ CString sKey(m_cMountlist.GetItemText(iItem,COLSHARE));
+ CString sPath(m_cMountlist.GetItemText(iItem,COLPATH));
+ CString sDrive(m_cMountlist.GetItemText(iItem,COLDRIVE));
+ CString sAuto(m_cMountlist.GetItemText(iItem,COLAUTO));
+ if (!sKey.IsEmpty() && !sPath.IsEmpty())
+ {// going a lot of trouble to handle any size buffer with out puting a limit on it
+ int len=sKey.GetLength()+sDrive.GetLength()+sAuto.GetLength()+2;
+ if (dused+len>=dcur)
+ dblock=(char *)realloc(dblock,(dcur+=128));
+ dptr=dblock+dused;
+ wsprintf(dptr,"%s=%s%s",sKey,sAuto,sDrive);
+ dused+=len;
+ if (stricmp(sKey,"all")==0) continue; //skip 'all' output
+ len=sKey.GetLength()+sPath.GetLength()+2;
+ if (sused+len>=scur)
+ sblock=(char *)realloc(sblock,(scur+=BLOCKSIZE));
+ sptr=sblock+sused;
+ wsprintf(sptr,"%s=%s",sKey,sPath);
+ sused+=len;
+ }
+ }
+ *(sblock+sused)=0; //put extra null at the end
+ *(dblock+dused)=0;
+ WritePrivateProfileSection("AFS Submounts",sblock,tINI);
+ WritePrivateProfileSection("AFS Drivemounts",dblock,dINI);
+ delete dblock;
+ delete sblock;
+ } else {
+ char sKey[MAXKEY+2];
+ CHAR sPath[MAX_PATH+1];
+ CHAR sDrive[DRIVESIZE+1];
+ CHAR sAuto[AUTOSIZE+1];
+ strcpy(sAuto," ");
+ int len;
+ CString path;
+ int keylen=GetPrivateProfileString("AFS Submounts", NULL, "", sKey, MAXKEY,tINI);
+ PCHAR pkey=sKey;
+ if (keylen>=MAXKEY)
+ {
+ CString msg;
+ msg.Format("Profile String Error - Too many entries (%d)",MAXSHARES);
+ HandleError(msg,TRUE);
+ return FALSE;
+ }
+ // lets scan for all and home first, we want to place them
+ //mode: 0=look for all, 1=look for home, 2=finish the rest
+ for(int mode=0;mode<3;mode++)
+ {
+ while (keylen>1)
+ {
+ switch (mode)
+ {
+ case 0: //we skip looking for all
+ break;
+ case 1:
+ if (stricmp(pkey,"home")!=0)
+ {
+ keylen-=(strlen(pkey)+1);
+ pkey+=(strlen(pkey)+1);
+ continue;
+ }
+ break;
+ default:
+ if((stricmp(pkey,"all")==0) || (stricmp(pkey,"home")==0))
+ {
+ keylen-=(strlen(pkey)+1);
+ pkey+=(strlen(pkey)+1);
+ continue;
+ }
+ break;
+ }
+ if (strlen(pkey)==0)
+ {
+ HandleError("Profile String Error - Empty key",FALSE);
+ ret=FALSE;
+ keylen-=(strlen(pkey)+1);
+ continue;
+ }
+ if (mode!=0)
+ {
+ if ((len=GetPrivateProfileString("AFS Submounts", pkey, "", sPath, MAX_PATH,tINI))==0)
+ {
+ CString msg;
+ msg.Format("Profile String Error on Submount key:%s",pkey);
+ HandleError(msg,FALSE);
+ ret=FALSE;
+ keylen-=(strlen(pkey)+1);
+ pkey+=(strlen(pkey)+1);
+ continue;
+ }
+ } else {
+ strcpy(sPath,"\\");
+ pkey="all";
+ }
+ *sDrive=0;
+ if ((len=GetPrivateProfileString("AFS Drivemounts", pkey, "", sDrive, DRIVESIZE,dINI))==0)
+ {
+ if ((stricmp("all",pkey)==0)||(stricmp("home",pkey)==0))
+ {// allow for no drive id on home
+ if (stricmp("home",pkey)==0)
+ strcpy(sDrive,"*U");
+ else
+ strcpy(sDrive,"*Z");
+ } else {
+ CString msg;
+ msg.Format("Profile String Error on Path key:%s",pkey);
+ HandleError(msg,TRUE);
+ ret=FALSE;
+ keylen-=(strlen(pkey)+1);
+ pkey+=(strlen(pkey)+1);
+ continue;
+ }
+ }
+ if (sDrive[0]=='*') //test for leading *
+ {
+ strcpy(sAuto,"*");
+ strrev(sDrive);
+ sDrive[strlen(sDrive)-1]=0;
+ } else
+ strcpy(sAuto," ");
+ sDrive[1]=0; //force to be single character
+ if (stricmp("home",pkey)==0) //force auto connect for home and all
+ {
+ m_bHomepath=TRUE;
+ }
+ strupr(sDrive);
+ if ((strlen(sDrive)!=1)||(strspn(sDrive,"ABCDEFGHIJKLMNOPQRSTUVWXYZ")==0))
+ {
+ if (stricmp("home",pkey)==0)
+ strcpy(sDrive,"U");
+ else if (stricmp("all",pkey)==0)
+ strcpy(sDrive,"Z");
+ else
+ strcpy(sDrive,"");
+ }
+ strcat(sDrive,":");
+ if (mode==0)
+ strcpy(sAuto,"*"); //no matter how it turns out 'all' is forced on.
+ AddToList(sDrive,sPath,pkey,sAuto);
+ if (mode<2) break;
+ keylen-=(strlen(pkey)+1);
+ pkey+=(strlen(pkey)+1);
+ }
+ switch (mode)
+ {
+ case 0:
+ if (keylen<=1) //we never found "all"
+ AddToList("Z:","\\","all","*");
+ keylen=GetPrivateProfileString("AFS Submounts", NULL, "", sKey, MAXKEY,tINI);
+ pkey=sKey;
+ break;
+ case 1:
+ if (keylen<=1) //we never found "home"
+ break;
+ keylen=GetPrivateProfileString("AFS Submounts", NULL, "", sKey, MAXKEY,tINI);
+ pkey=sKey;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return ret;
+}
+
+void CWinAfsLoadDlg::OnChange()
+{
+ // TODO: Add your control notification handler code here
+
+ POSITION pos = m_cMountlist.GetFirstSelectedItemPosition();
+ if (pos == NULL) return;
+ int nItem = m_cMountlist.GetNextSelectedItem(pos);
+ UINT state=m_cMountlist.GetCheck(nItem);
+ if (state)
+ {
+ MessageBox("You cannot change Item from the list while connected!","AFS - Warning",MB_OK|MB_ICONWARNING);
+ return;
+ }
+ CChange dlg(TRUE,this);
+ dlg.m_sDrive=m_cMountlist.GetItemText(nItem,COLDRIVE);
+ dlg.m_sPath=m_cMountlist.GetItemText(nItem,COLPATH);
+ dlg.m_sDescription=m_cMountlist.GetItemText(nItem,COLSHARE);
+ dlg.m_bAuto=(strcmp(m_cMountlist.GetItemText(nItem,COLAUTO),"*")==0);
+ if (dlg.DoModal()==IDCANCEL) return;
+ m_cMountlist.SetItemText(nItem,COLDRIVE,dlg.m_sDrive);
+ m_cMountlist.SetItemText(nItem,COLPATH,dlg.m_sPath);
+ m_cMountlist.SetItemText(nItem,COLSHARE,dlg.m_sDescription);
+ m_cMountlist.SetItemText(nItem,COLAUTO,(dlg.m_bAuto)?"*":" ");
+ UpdateData(FALSE);
+ ProfileData(TRUE);
+}
+
+VOID CWinAfsLoadDlg::AddToList(const char *sDrive,const char *sPath,const char *sShare,const char *sAuto)
+{
+ LV_ITEM lvitem;
+ memset(&lvitem,0,sizeof(lvitem));
+ int iSubItem,iActualItem;
+ int iItem;
+ if (stricmp(sShare,"home")==0)
+ iItem=1;
+ else if (stricmp(sShare,"all")==0)
+ iItem=0;
+ else {
+ iItem=m_cMountlist.GetItemCount();
+ if (iItem<1) iItem=2;
+ }
+
+ for (iSubItem = 0; iSubItem < NUMCOL; iSubItem++)
+ {
+ lvitem.mask = LVIF_TEXT ;//| (iSubItem == 0? LVIF_IMAGE : 0);
+ lvitem.iItem = (iSubItem == 0)? iItem : iActualItem;
+ lvitem.iSubItem = iSubItem;
+ lvitem.iImage = 0;
+ switch(iSubItem)
+ {
+ case COLDRIVE:
+ lvitem.pszText=(char *)sDrive;
+ break;
+ case COLPATH:
+ lvitem.pszText=(char *)sPath;
+ break;
+ case COLSHARE:
+ lvitem.pszText=(char *)sShare;
+ break;
+ case COLAUTO:
+ lvitem.pszText=(char *)sAuto;
+ break;
+ default:
+ break;
+ }
+ if (iSubItem == 0)
+ iActualItem = m_cMountlist.InsertItem(&lvitem); // insert new item
+ else
+ m_cMountlist.SetItem(&lvitem); // modify existing item (the sub-item text)
+ }
+
+}
+
+void CWinAfsLoadDlg::OnAdd()
+{
+ // TODO: Add your control notification handler code here
+ CChange dlg(FALSE,this);
+ if (dlg.DoModal()==IDCANCEL) return;
+ //return m_sDescription, m_sPath, m_sDrive
+ AddToList(dlg.m_sDrive,dlg.m_sPath,dlg.m_sDescription,(dlg.m_bAuto)?"*":" ");
+ UpdateData(FALSE);
+ ProfileData(TRUE); //update INI list if changed
+}
+
+
+void CWinAfsLoadDlg::OnRemove()
+{
+ // TODO: Add your control notification handler code here
+
+ POSITION pos = m_cMountlist.GetFirstSelectedItemPosition();
+ if (pos == NULL) return;
+ while (pos)
+ {
+ int nItem = m_cMountlist.GetNextSelectedItem(pos);
+ UINT state=m_cMountlist.GetCheck(nItem);
+ if (state)
+ {
+ HandleError("You cannot remove Item from the list while connected!");
+ continue;
+ }
+ if (stricmp(m_cMountlist.GetItemText(nItem,COLSHARE),"all")==0)
+ {
+ HandleError("You cannot remove 'All' Item from the list!");
+ continue;
+ }
+ m_cMountlist.DeleteItem(nItem);
+ }
+ ProfileData(TRUE);
+}
+
+// FOLLOWING ROUITNE IS required so OnItemchangedDrivemountlist can tell the difference
+// between a user changing an item to mount/dismount or the program is just updating the display
+// unfortunately any changes go thourgh OnItemchangedDrivemountlist
+void CWinAfsLoadDlg::OnClickDrivemountlist(NMHDR* pNMHDR, LRESULT* pResult)
+{
+ // TODO: Add your control notification handler code here
+
+ *pResult = 0;
+ NM_LISTVIEW* pListview = (NM_LISTVIEW*)pNMHDR;
+ CString msg;
+ *pResult=0;
+ m_iActiveItem=pListview->iItem; //this is the only place where items changed are done by user click
+}
+
+void CWinAfsLoadDlg::UpdateMountDisplay()
+{
+ TCHAR szDrive[] = TEXT("*:");
+ TCHAR szMapping[ MAX_PATH ] = TEXT("");
+ LPTSTR pszSubmount = szMapping;
+ DWORD dwSize = MAX_PATH;
+ TCHAR pDrive[DRIVESIZE+1];
+ TCHAR pShare[SHARENAMESIZE+1];
+ ASSERT(strlen(m_cAfs.MountName())!=0);
+ BOOL update=FALSE;
+ for (int iItem=m_cMountlist.GetItemCount()-1;iItem>=0;iItem--)
+ {
+ m_cMountlist.GetItemText(iItem,COLDRIVE,pDrive,DRIVESIZE);
+ m_cMountlist.GetItemText(iItem,COLSHARE,pShare,SHARENAMESIZE);
+ if ((WNetGetConnection(pDrive, szMapping, &dwSize) == NO_ERROR)
+ && (strstr(szMapping,m_cAfs.MountName())!=NULL))
+ {
+ if ((stricmp((strrchr(szMapping,'\\')+1),pShare)==0)
+ && (!m_cMountlist.GetCheck(iItem)))
+ {
+ m_cMountlist.SetCheck(iItem,TRUE);
+ AddMenu(m_cMountlist.GetItemText(iItem,COLDRIVE),m_cMountlist.GetItemText(iItem,COLSHARE));
+ update=TRUE;
+ }
+ }
+ else {
+ if (m_cMountlist.GetCheck(iItem))
+ {
+ m_cMountlist.SetCheck(iItem,FALSE);
+ RemoveMenu(m_cMountlist.GetItemText(iItem,COLDRIVE));
+ update=TRUE;
+ }
+ }
+ }
+ if (update)
+ m_cMountlist.Invalidate();
+}
+
+void CWinAfsLoadDlg::OnItemchangedDrivemountlist(NMHDR* pNMHDR, LRESULT* pResult)
+{
+ NM_LISTVIEW* pListview = (NM_LISTVIEW*)pNMHDR;
+ CString msg;
+ *pResult=0;
+ if ((pListview->uNewState & (ITEMCHECKED | ITEMNOTCHECKED))!=(pListview->uOldState & 0x3000))
+ {
+ if (m_iActiveItem<0) return; //no processing needed if not initiated by a mouse click
+ m_iActiveItem=-1;
+ switch (pListview->uNewState & (ITEMCHECKED | ITEMNOTCHECKED))
+ {
+ case ITEMCHECKED: //mount a drive
+ if (!m_bServiceIsActive)
+ {// can't allow mounting if connection not active
+ HandleError("You must connect first");
+ m_cMountlist.SetCheck(pListview->iItem,FALSE);
+ return;
+ }
+ LOG("Connect %s %s",m_cMountlist.GetItemText(pListview->iItem,COLDRIVE),m_cMountlist.GetItemText(pListview->iItem,COLSHARE));
+ {
+ CProgress progress(this,4);
+ if (!m_cAfs.Mount(msg
+ ,m_cMountlist.GetItemText(pListview->iItem,COLDRIVE)
+ ,m_cMountlist.GetItemText(pListview->iItem,COLSHARE)))
+ {
+ m_cMountlist.SetCheck(pListview->iItem,FALSE);
+ UpdateData(FALSE);
+ HandleError(msg);
+ return;
+ }
+ AddMenu(m_cMountlist.GetItemText(pListview->iItem,COLDRIVE),m_cMountlist.GetItemText(pListview->iItem,COLSHARE));
+ }
+ break;
+ case ITEMNOTCHECKED: //dismount a drive
+ {
+ BOOL force=FALSE;
+ LOG("Disconnect %s",m_cMountlist.GetItemText(pListview->iItem,COLDRIVE));
+ do
+ {
+ if (!m_cAfs.Dismount(msg,m_cMountlist.GetItemText(pListview->iItem,COLDRIVE),force))
+ {// there was an error, allow the user to force closing the drive anyway
+ CRetry dlg(TRUE);
+ dlg.m_sMsg=msg;
+ switch (dlg.DoModal())
+ {
+ case IDOK:
+ continue;
+ case IDC_FORCE:
+ force=TRUE;
+ continue;
+ default:
+ m_cMountlist.SetCheck(pListview->iItem,TRUE);
+ return;
+ }
+ }
+ RemoveMenu(m_cMountlist.GetItemText(pListview->iItem,COLDRIVE));
+ break;
+ } while (TRUE);
+ }
+ break;
+ default:
+ break;
+ }
+ return;
+ }
+ POSITION pos = m_cMountlist.GetFirstSelectedItemPosition();
+ if (pos == NULL)
+ {
+ m_cRemove.ModifyStyle(0,WS_DISABLED,0);
+ m_cChange.ModifyStyle(0,WS_DISABLED,0);
+ } else {
+ m_cRemove.ModifyStyle(WS_DISABLED,0,0);
+ m_cMountlist.GetNextSelectedItem(pos);
+ if (pos==NULL)
+ m_cChange.ModifyStyle(WS_DISABLED,0,0);
+ else
+ m_cChange.ModifyStyle(0,WS_DISABLED,0);
+ }
+ m_cChange.Invalidate(TRUE);
+ m_cRemove.Invalidate(TRUE);
+ m_iActiveItem=-1;
+}
+
+void CWinAfsLoadDlg::BuildDriveList(BOOL newone)
+{//if force then build a newone
+
+ DWORD mapDrive=GetLogicalDrives();
+ TCHAR szDrive[] = TEXT("*: ");
+ int iItem;
+ if (newone)
+ {
+ m_Drivelist.RemoveAll();
+ TCHAR szMapping[ MAX_PATH ] = TEXT("");
+ LPTSTR pszSubmount = szMapping;
+ DWORD dwSize = MAX_PATH;
+ TCHAR stDrive[]=TEXT("*:");
+ for (iItem = 2;iItem <= 25; ++iItem)
+ {
+ szDrive[0]=stDrive[0]=iItem+'A';
+ if (((mapDrive & 1<<iItem)==0) // if drive is not in use or it is a network assigned drive
+ // then place it on the available drive list
+ || (WNetGetConnection (stDrive, szMapping, &dwSize) == NO_ERROR))
+ {
+ m_Drivelist.AddTail(CString(szDrive));
+ }
+ }
+ return;
+ }
+ //update drive list seting * for thoes drives already in use
+ for (iItem=m_Drivelist.GetCount()-1;iItem>=0;iItem--)
+ {
+ strcpy(szDrive,m_Drivelist.GetAt(m_Drivelist.FindIndex(iItem)));
+ szDrive[3]= ((1<<(szDrive[0]-'A')) & mapDrive)?'*' :' ';
+ m_Drivelist.SetAt(m_Drivelist.FindIndex(iItem),CString(szDrive));
+ }
+}
+
+void CWinAfsLoadDlg::ExtractDrive(CString &zdrive,const char *request)
+{// extract the cloest drive to the requested letter
+ POSITION pos = m_Drivelist.Find(CString(request));
+ if (pos)
+ {
+ zdrive=m_Drivelist.GetAt(pos);
+ m_Drivelist.RemoveAt(pos);
+ return;
+ }
+ int count=m_Drivelist.GetCount()-4;
+ if (count<0) count=0;
+ pos=m_Drivelist.FindIndex(count);
+ zdrive=m_Drivelist.GetAt(pos);
+ m_Drivelist.RemoveAt(pos);
+}
+
+HCURSOR CWinAfsLoadDlg::OnQueryDragIcon()
+{
+ return (HCURSOR) m_hIcon;
+}
+
+
+// Main menu close statement
+BOOL CWinAfsLoadDlg::OnQueryEndSession( )
+{
+ ShowWindow(SW_SHOW);
+ CString msg;
+ if (!DismountAll(msg,1))// disconnect any connected AFS mounts, unless there are files open!
+ return FALSE;
+ TerminateBackground();
+ if (m_nDirTimer) //Destroy Window is not being called
+ KillTimer(m_nDirTimer);
+ if (m_nAutTimer)
+ KillTimer(m_nAutTimer);
+ m_nAutTimer=m_nDirTimer=0;
+ return !m_bServiceIsActive;
+}
+
+void CWinAfsLoadDlg::OnTimer(UINT nIDEvent)
+{
+ // TODO: Add your message handler code here and/or call default
+ char pBuffer[64];
+ int len;
+ char *p=NULL;
+ CString msg;
+ switch (nIDEvent)
+ {
+ case WM_DIRTIMER:
+ switch (m_seqIndex)
+ {
+ case 22:
+ case 25://1.0
+ if ((m_seqCount+=TIMEINTERVAL)<1000)
+ break;
+ case 23: //0.75
+ if ((m_seqCount+=TIMEINTERVAL)<500)
+ break;
+ case 20:
+ case 21:
+ case 24:
+ case 26://0.5
+ if ((m_seqCount+=TIMEINTERVAL)<500)
+ break;
+ default://0.2
+ m_seqCount=0;
+ if (++m_seqIndex>MAXWORLDINDEX) m_seqIndex=0;
+ m_bmpWorld.UpdateMask(this,m_WorldRect);//build new mask and force repaint of world area
+ break;
+ }
+ if ((!m_bServiceIsActive) || (m_bRestartAFSD)) break;
+ if ((m_dirCount+=TIMEINTERVAL)<CHECKDIR) break;
+ m_dirCount=0;
+ len=::GetWindowText(m_cAfs.GetLoadWindowHandle(),pBuffer,64);
+ if ((len==0) || ((p=strstr(pBuffer,"Finish"))!=NULL))
+ {// if p!=NULL then application is finished but not totally shutdown
+ if (p)
+ {
+ ::SendMessage(m_cAfs.GetLoadWindowHandle(),WM_CLOSE,0,0);
+ LOG("WM_CLOSE4");
+ }
+ CString msg;
+ DismountAll(msg,3); //unfortunately all drive references are invalid also!
+ m_bServiceIsActive=FALSE;
+ UpdateConnect();
+ break;
+ }
+ if (!m_cCheckAdvanceDisplay.GetCheck()) break;
+ if ((WS_VISIBLE & GetStyle()) )
+ UpdateMountDisplay();
+ break;
+ case WM_AUTTIMER:
+ if ((!m_bServiceIsActive) || m_bRestartAFSD) break;
+ switch (m_cAfs.TestTokenTime(msg))
+ {
+ case 0:
+ if (m_nShown==0) break;
+ m_cAuthWarn.ShowWindow(SW_HIDE);
+ m_cAuthWarn.Invalidate(TRUE);
+ m_nShown=0;
+ break;
+ case -1:
+ if (m_nShown==-1) break;
+ HandleError(msg);
+ ShowWindow(SW_SHOWDEFAULT);
+ m_nShown=-1;
+ break;
+ case 1:
+ if (m_nShown==1) break;
+ m_bkBrush.DeleteObject();
+ m_bkBrush.CreateSolidBrush(RGB(255,255,0));
+ m_cAuthWarn.SetWindowText(msg);
+ m_cAuthWarn.Invalidate(TRUE);
+ m_cAuthWarn.ShowWindow(SW_SHOW);
+ ShowWindow(SW_SHOWDEFAULT);
+ m_nShown=1;
+ LOG(msg);
+ break;
+ case 2:
+ if (m_nShown==2) break;
+ m_bkBrush.DeleteObject();
+ m_bkBrush.CreateSolidBrush(RGB(255,0,0));
+ m_cAuthWarn.ShowWindow(SW_SHOW);
+ m_cAuthWarn.SetWindowText(msg);
+ m_cAuthWarn.Invalidate(TRUE);
+ ShowWindow(SW_SHOWDEFAULT);
+ LOG(msg);
+ m_nShown=2;
+ break;
+ default:
+ break;
+ }
+
+ break;
+ default:
+ break;
+ }
+ CDialog::OnTimer(nIDEvent);
+}
+
+void CWinAfsLoadDlg::OnAuthenicate()
+{
+ // TODO: Add your control notification handler code here
+ CString msg;
+ CWait wait;
+ UpdateData(TRUE);
+ m_nShown=0;
+ m_cAuthWarn.ShowWindow(SW_HIDE);
+ LOG("Re-Authenication");
+ if (!m_cAfs.Authencate(msg,m_sUsername,m_sPassword))
+ {
+ HandleError(msg);
+ return;
+ }
+ if (!m_cSaveUsername.GetCheck())
+ {
+ m_sPassword.Empty();
+ UpdateData(FALSE);
+ }
+}
+
+
+void CWinAfsLoadDlg::OnDestroy()
+{
+
+// ASSERT( m_hBmpOld );
+// VERIFY( m_dcMem.SelectObject( CBitmap::FromHandle(m_hBmpOld) ) );
+ // Need to DeleteObject() the bitmap that was loaded
+ m_bmpWorld.DeleteObject();
+
+ // m_dcMem destructor will handle rest of cleanup
+
+ if (m_nDirTimer) //it is better to kill the timer here than PostNcDestroy
+ KillTimer(m_nDirTimer);
+ if (m_nAutTimer)
+ KillTimer(m_nAutTimer);
+ m_nAutTimer=m_nDirTimer=0;
+ CDialog::OnDestroy();
+
+ // TODO: Add your message handler code here
+
+}
+
+// Here is how we change the Background color for the yellow warning
+HBRUSH CWinAfsLoadDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
+{
+ HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
+
+ // TODO: Change any attributes of the DC here
+ if (pWnd->GetDlgCtrlID() == IDC_AUTHWARN)
+ {
+ pDC->SetBkMode(TRANSPARENT); // we have to make text background transparent
+ return (HBRUSH)m_bkBrush; // Return a different brush (YELLOW)
+ }
+
+ return hbr;
+}
+
+void CWinAfsLoadDlg::OnShow()
+{
+ // TODO: Add your command handler code here
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+
+ if (pSysMenu != NULL)
+ {
+ if (0xFFFFFFFF!=pSysMenu->GetMenuState(IDM_CAPTUREWINDOW, MF_BYCOMMAND))
+ return;
+ CSettings dlg(this);
+ dlg.DoModal();
+ OnShowAddMenus();
+ }
+}
+
+void CWinAfsLoadDlg::OnShowAddMenus()
+{
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu == NULL) return;
+ CString strMenu;
+ pSysMenu->AppendMenu(MF_SEPARATOR);
+ strMenu.LoadString(IDM_CAPTUREWINDOW);
+ pSysMenu->AppendMenu(MF_STRING, IDM_CAPTUREWINDOW, strMenu);
+ strMenu.LoadString(IDM_CAPTUREFILE);
+ pSysMenu->AppendMenu(MF_STRING, IDM_CAPTUREFILE, strMenu);
+ strMenu.LoadString(IDM_VIEWAFS);
+ pSysMenu->AppendMenu(MF_STRING, IDM_VIEWAFS, strMenu);
+}
+
+// Signaled when AFSD sends a socket message
+LRESULT CWinAfsLoadDlg::OnPowerBroadcast(WPARAM wParam, LPARAM lParam)
+{
+ CString msg;
+ CString sDrive;
+ CString sKey;
+ BOOL result=TRUE;
+ switch(wParam)
+ {
+ case PBT_APMSUSPEND:
+ LOG("PBT_APMSUSPEND");
+ break;
+ case PBT_APMQUERYSUSPEND:
+ // if lParam & 1 ==1 then you can prompt user for info
+ LOG("PBT_APMQUERYSUSPEND");
+#if WIN95TEST
+ if (IsWin95())
+ {// Windows 95
+ CString *emsg=new CString;
+ emsg->Format("Warning: Attempt to Suspend was Denied\nPower Suspend on Windows 95 is not compatable with Ufiler. \nYou may be required to reboot before using Ufilier again!");
+ PostMessage(WM_ERRORMSG,AFS_EXITCODE_GENERAL_FAILURE,(LPARAM)emsg);
+
+ return BROADCAST_QUERY_DENY; //deny suspension
+ }
+#endif
+ if (m_bRestartAFSD)
+ break;
+ if (m_bServiceIsActive)
+ {
+
+ if (
+ (!IsWin95()) // WIN95 will suspend anyway
+ && (!m_cAfs.CheckNet(msg))
+
+ )
+
+ {
+ if (lParam &1)
+ {
+ CString *emsg=new CString;
+ emsg->Format("Attempt to Suspend Denied\n%s",msg);
+ PostMessage(WM_ERRORMSG,AFS_EXITCODE_GENERAL_FAILURE,(LPARAM)emsg);
+ }
+ LOG("AFS Client Console stopped, powerdown denied.");
+ return BROADCAST_QUERY_DENY; //files open suspend denied
+ }
+ CString *emsg=new CString;
+ // Allow power suspension even though termination incomplete (no files open anyway)
+ if (!TerminateBackground(FALSE,emsg))
+ {
+ if (lParam &1)
+ {
+ m_cConnect.ModifyStyle(0,WS_DISABLED,0);
+ m_cConnect.Invalidate();
+ m_cCancel.SetWindowText("Exit");
+ m_cCancel.Invalidate();
+ m_trayIcon.SetConnectState(2);
+ m_bServiceIsActive=FALSE;
+ PostMessage(WM_ERRORMSG,AFS_EXITCODE_GENERAL_FAILURE,(LPARAM)emsg);
+ result=FALSE;
+ }
+ } else
+ delete emsg;
+ m_bServiceIsActive=FALSE;
+ }
+ // terminate socket connection (even if terminatebackground failed
+ REQUESTUISUSPENDEVENT(ONPARMDISCONNECT);
+ {
+ WPARAM wp;
+ CString msg;
+ CWINAFSLOADAPP->WaitForEvent(SOCKETIO+2000,&wp,&msg); //wait 2 second longer than any socket IO
+ switch (wp)
+ {
+ case AFS_EXITCODE_NORMAL:
+ break;
+ default:
+ // have to post message to myself so I can return Querry deny immediately
+ {
+ CString *emsg=new CString(msg);
+ m_cConnect.ModifyStyle(0,WS_DISABLED,0);
+ m_cConnect.Invalidate();
+ m_cCancel.SetWindowText("Exit");
+ m_cCancel.Invalidate();
+ PostMessage(WM_ERRORMSG,AFS_EXITCODE_GENERAL_FAILURE,(LPARAM)emsg);
+ m_trayIcon.SetConnectState(2);
+ result=FALSE;
+ }
+ }
+ }
+ m_bRestartAFSD=result;
+ break;
+ case PBT_APMRESUMESUSPEND:
+ LOG("PBT_APMRESUMESUSPEND");
+ REQUESTUIPOSTEVENT(WM_UICONNECT,WM_CONNECTRETURN,0);
+ break;
+ case PBT_APMRESUMECRITICAL:
+ LOG("PBT_APMRESUMECRITICAL");
+ REQUESTUIPOSTEVENT(WM_UICONNECT,WM_CONNECTRETURN,0);
+ break;
+ default:
+ break;
+ }
+ UpdateConnect();
+ return true;
+}
+
+
+// lParam will contain CString, they must be deleted when done!
+LRESULT CWinAfsLoadDlg::OnErrorMessage(WPARAM wParam, LPARAM lParam)
+{
+ CString *msg=(CString *)lParam;
+ MessageBox(*msg,"AFS Control Panel Warning");
+ delete msg;
+ return TRUE;
+}
+
+// actual message comes from AfsLoad (CWinApp)
+LRESULT CWinAfsLoadDlg::OnAfsEvent(WPARAM wParam, LPARAM lParam)
+{
+ ASSERT(lParam);
+ CString * msg=(CString *)lParam;
+ CString emsg;
+ emsg.Format("OnAfsEvent %x [%s]",wParam,(const char *)(*msg));
+ LOG((const char *)emsg);
+ switch (wParam)
+ {
+ case AFS_EXITCODE_NORMAL:
+ break;
+ default:
+ MessageBox((const char*)(*msg),"AFS Client Console Failure");
+ break;
+ }
+ if (msg)
+ delete msg;
+ return 0;
+}
+
+
+void CWinAfsLoadDlg::ErrorDisplayState()
+{
+ m_cConnect.ModifyStyle(0,WS_DISABLED,0);
+ m_cConnect.Invalidate();
+ m_cCancel.SetWindowText("Exit");
+ m_cCancel.Invalidate();
+ m_cAuthenicate.ModifyStyle(0,WS_DISABLED,0);
+ m_cAuthenicate.Invalidate();
+ UpdateConnect();
+}
+
+static CProgress *m_progress=NULL;
+
+// all calls must have set lParam null or contain a message to release
+// actual message comes from AfsLoad (CWinApp)
+LRESULT CWinAfsLoadDlg::OnNotifyReturn(WPARAM wParam, LPARAM lParam)
+{// fields messages from a NotifyFromUI, e.g. ONCONNECT ONPING
+// lParam contains the message that must be released
+ CString msg;
+ int iItem;
+ CString sDrive;
+ CString sKey;
+ switch(wParam)
+ {
+ case WM_CONNECTRETURN:
+ if (lParam)
+ {// we had a failure
+ HandleError(*(CString *)lParam);
+ delete (CString *)lParam;
+ m_bRestartAFSD=FALSE;
+ ErrorDisplayState();
+ break;
+ }
+ if (!m_bRestartAFSD)
+ break;
+ m_progress = new CProgress(this,7);
+ if (m_progress)
+ {
+ m_progress->SetTitle("Power Restart","Enable AFS Client Console","Authenication");
+ m_progress->Next();
+ }
+ if (IsWin95())
+ {
+ LOG("Wait %d seconds to Bring up AFSD",m_PowerResumeDelay);
+ return TRUE; // do a return instead of break so Delete won't be called
+ }
+ case WM_RESUMEDELAY:
+ case WM_PINGRETURN: //we will return here after CONNECT(ONPING) finds the server connected
+ LOG("Done with delay, load AFSD");
+ if (m_progress)
+ m_progress->Next();
+ {
+ m_bRestartAFSD=FALSE;
+ if (lParam)
+ {// we had a failure
+ HandleError(*(CString *)lParam);
+ delete (CString *)lParam;
+ ErrorDisplayState();
+ break;
+ }
+ if (m_progress)
+ m_progress->Next();
+ if (!m_cAfs.Create(msg,m_sComputername,m_procInfo))
+ {
+ HandleError(msg);
+ m_procInfo.hThread=0;
+ ErrorDisplayState();
+ break;
+ } else
+ LOG("AFS Client Powerup started successfully.");
+ for (iItem=0;iItem<m_cMountlist.GetItemCount();iItem++)
+ {
+ sKey = m_cMountlist.GetItemText(iItem,COLSHARE);
+ if (stricmp(sKey,"all")!=0) continue;
+ CString sAuto(m_cMountlist.GetItemText(iItem,COLAUTO));
+ if (sAuto!="*")
+ continue;
+ sDrive=m_cMountlist.GetItemText(iItem,COLDRIVE);
+ LOG("Connect %s %s",sDrive,sKey);
+ m_cAfs.Dismount(msg,sDrive,TRUE);
+ if (!m_cAfs.Mount(msg,sDrive,sKey))
+ {
+ CString msg2;
+ m_cAfs.Shutdown(msg2);
+ m_procInfo.hThread=0;
+ msg2.Format("Connect can't continue: %s",msg);
+ HandleError(msg2);
+ ErrorDisplayState();
+ return true;
+ }
+ AddMenu(sDrive,sKey);
+ break;
+ }
+ if (m_progress)
+ m_progress->Next();
+ if (!m_cAfs.Authencate(msg,m_sUsername,m_sPassword))
+ {
+ CString msg2;
+ DismountAll(msg,3); //unfortunately all drive references are invalid also!
+ m_cAfs.Shutdown(msg2);
+ m_procInfo.hThread=0;
+ HandleError(msg);
+ ErrorDisplayState();
+ if (m_progress)
+ delete m_progress;
+ return true;
+ }
+ m_bServiceIsActive=TRUE;
+ }
+ break;
+ default:
+ if (lParam)
+ delete (CString *)lParam;
+ break;
+ }
+ UpdateConnect();
+ if (m_progress)
+ delete m_progress;
+ return true;
+}
+
+
+BOOL CWinAfsLoadDlg::OnHelpInfo(HELPINFO* pHelpInfo)
+{
+ // TODO: Add your message handler code here and/or call default
+ ::WinHelp(m_hWnd,CWINAFSLOADAPP->m_pszHelpFilePath,HELP_CONTEXT,IDH_MAIN);
+ return TRUE;
+}
+
+void CWinAfsLoadDlg::OnHelpmain()
+{
+ // TODO: Add your control notification handler code here
+ ::WinHelp(m_hWnd,CWINAFSLOADAPP->m_pszHelpFilePath,HELP_CONTEXT,IDH_MAIN);
+
+}
+
+void CWinAfsLoadDlg::OnSettings()
+{
+ // TODO: Add your control notification handler code here
+ CRegkey regkey("AFS\\Window");
+ CCommandSettings dlg;
+ dlg.m_ConnectOnStart= CWINAFSLOADAPP->m_bConnect;
+ dlg.m_LogToWindow=CWINAFSLOADAPP->m_bLogWindow;
+ dlg.m_LogToFile=CWINAFSLOADAPP->m_bLog;
+ dlg.m_UserName=m_sUsername;
+ UINT tvar;
+ DWORD size=sizeof(tvar);
+ regkey.GetBinary("LoginTime",(LPBYTE)&tvar,size);
+ dlg.m_uMaxLoginTime=tvar;
+ dlg.m_uMaxPowerRestartDelay=m_PowerResumeDelay;
+ if (dlg.DoModal()==IDOK)
+ {
+ if (dlg.m_LogToWindow ^ CWINAFSLOADAPP->m_bLogWindow)
+ CWINAFSLOADAPP->ShowLog(dlg.m_LogToWindow);
+ if (dlg.m_LogToFile ^ CWINAFSLOADAPP->m_bLog)
+ CWINAFSLOADAPP->ShowPrint(dlg.m_LogToFile);
+ CWINAFSLOADAPP->m_bLogWindow=dlg.m_LogToWindow;
+ CWINAFSLOADAPP->m_bLog=dlg.m_LogToFile;
+ CWINAFSLOADAPP->m_bConnect=dlg.m_ConnectOnStart;
+ CWINAFSLOADAPP->RegOptions(FALSE);
+ tvar=dlg.m_uMaxLoginTime;
+ regkey.PutBinary("LoginTime",(LPBYTE)&tvar,size);
+ m_PowerResumeDelay=dlg.m_uMaxPowerRestartDelay;
+ regkey.PutBinary("PowerResumeDelay",(LPBYTE)&m_PowerResumeDelay,size);
+ }
+}
+
--- /dev/null
+// WinAfsLoadDlg.h : header file
+//
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#if !defined(AFX_WINAFSLOADDLG_H__75E145B5_F5C0_11D3_A374_00105A6BCA62__INCLUDED_)
+#define AFX_WINAFSLOADDLG_H__75E145B5_F5C0_11D3_A374_00105A6BCA62__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+#include "trayicon.h"
+#include "datalog.h"
+#include "cafs.h"
+#include <afxtempl.h>
+#include "share.h"
+#include "transbmp.h"
+/////////////////////////////////////////////////////////////////////////////
+// CWinAfsLoadDlg dialog
+class CSettings;
+class CEncript;
+
+class CWinAfsLoadDlg : public CDialog
+{
+// Construction
+ friend CSettings;
+public:
+ CWinAfsLoadDlg(const char *user,const char *pass,CWnd* pParent = NULL); // standard constructor
+ void HandleError(const char *s,BOOL b=TRUE);
+ void BuildDriveList(BOOL newone=FALSE);
+ CList<CString,CString&> m_Drivelist;
+ void OnShowAddMenus();
+ LRESULT OnNotifyReturn(WPARAM wParam, LPARAM lParam);
+ LRESULT OnAfsEvent(WPARAM wParam, LPARAM lParam);
+
+// Dialog Data
+ //{{AFX_DATA(CWinAfsLoadDlg)
+ enum { IDD = IDD_WINAFSLOAD_DIALOG };
+ CButton m_Down;
+ CButton m_Enable;
+ CButton m_cWorld;
+ CStatic m_cAuthWarn;
+ CButton m_cAuthenicate;
+ CButton m_cSaveUsername;
+ CListCtrl m_cMountlist;
+ CButton m_cChange;
+ CButton m_cRemove;
+ CButton m_cOptionLine;
+ CButton m_cCheckAdvanceDisplay;
+ CButton m_cConnect;
+ CButton m_cCancel;
+ CEdit m_cPassword;
+ CEdit m_cUsername;
+ CString m_sPassword;
+ CString m_sUsername;
+ CString m_sMountDisplay;
+ //}}AFX_DATA
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CWinAfsLoadDlg)
+ public:
+ virtual BOOL PreTranslateMessage(MSG* pMsg);
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void PostNcDestroy();
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ CAfs m_cAfs;
+ CTrayIcon m_trayIcon; // my tray icon
+ HICON m_hIcon;
+ BOOL m_bHomepath;
+ BOOL m_bServiceIsActive; //service is active
+ PROCESS_INFORMATION m_procInfo;
+ UINT m_DialogShrink;
+ CRect m_OriginalRect;
+ CString m_sComputername;
+ BOOL TerminateBackground(BOOL bDisplay=TRUE,CString *emsg=NULL);
+ BOOL OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult );
+ BOOL RegPassword(CString &user,CString &pass,BOOL fetch);
+ CImageList *m_pImagelist;
+ BOOL ProfileData(BOOL put);
+ void AddToList(const char *sDrive,const char *sPath,const char *sShare,const char *sAuto);
+ void ExtractDrive(CString &zdrive,const char *request);
+ int m_iActiveItem;
+ BOOL DismountAll(CString &msg,INT mode);
+ HACCEL m_hAccelTable;
+ CString m_sLoginName;
+ BOOL m_bSaveUsername; //TRUE means a click will save, FALSE will mean to clear
+ void UpdateMountDisplay();
+ UINT m_nDirTimer; //Timer for directory update
+ UINT m_nAutTimer; //Timer for authenicate testing
+ BOOL RegLastUser(CString &user,BOOL fetch);
+ void UpdateConnect();
+ UINT m_nShown; //SET according level of warning has occured
+ CBrush m_bkBrush;
+ INT m_seqIndex; //index count for whirling world
+ INT m_seqCount; //count in each sequence
+ INT m_dirCount; //number of 1/2 seconds to wait before checking changes in directory
+ CTransBmp m_bmpWorld; // Bitmap to display, special bit map that does transparent painting
+ CRect m_WorldRect;
+ BOOL m_bRestartAFSD; //were we suspended???
+ BOOL m_bConnect; //option to automatically start connected
+ INT m_iMode;
+ CEncript *m_pEncript;
+ sockaddr_in m_sHostIP;
+ OSVERSIONINFO m_OSVersion;
+ BOOL IsWin95(){
+ return (
+ (m_OSVersion.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS)
+ && (m_OSVersion.dwMinorVersion==0)
+ );
+ }
+ void ErrorDisplayState();
+ int m_PowerResumeDelay;
+ void AddMenu(const char *,const char *);
+ void RemoveMenu(const char *);
+
+// int m_PowerDelay; //power delay hack
+
+ // Generated message map functions
+ //{{AFX_MSG(CWinAfsLoadDlg)
+ virtual BOOL OnInitDialog();
+ afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
+ afx_msg void OnPaint();
+ afx_msg void OnConnect();
+ afx_msg void OnCancel();
+ afx_msg void OnCheckadvanced();
+ afx_msg void OnAppOpen();
+ afx_msg void OnChange();
+ afx_msg void OnAdd();
+ afx_msg void OnRemove();
+ afx_msg void OnClickDrivemountlist(NMHDR* pNMHDR, LRESULT* pResult);
+ afx_msg void OnItemchangedDrivemountlist(NMHDR* pNMHDR, LRESULT* pResult);
+ afx_msg BOOL OnQueryEndSession( );
+ afx_msg void OnTimer(UINT nIDEvent);
+ afx_msg void OnAuthenicate();
+ afx_msg void OnDestroy();
+ afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
+ afx_msg void OnShow();
+ afx_msg void OnSuspend();
+ afx_msg void OnResume();
+ afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
+ afx_msg void OnHelpmain();
+ afx_msg void OnSettings();
+ //}}AFX_MSG
+ afx_msg void OnTrayButton0();
+ afx_msg void OnTrayButton1();
+ afx_msg void OnTrayButton2();
+ afx_msg void OnTrayButton3();
+ afx_msg void OnTrayButton4();
+ afx_msg HCURSOR OnQueryDragIcon();
+ afx_msg LRESULT OnPowerBroadcast(WPARAM wParam, LPARAM lParam);
+ afx_msg LRESULT OnErrorMessage(WPARAM wParam, LPARAM lParam);
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_WINAFSLOADDLG_H__75E145B5_F5C0_11D3_A374_00105A6BCA62__INCLUDED_)
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+/* api functions for access to AFS pioctl functions from windows gui */
+
+#include "stdafx.h"
+#ifdef _MFC_VER
+extern "C" {
+#endif
+#include <afs/param.h>
+#include <afs/stds.h>
+#ifdef _MFC_VER
+ }
+#endif
+/*#include <afs/pioctl_nt.h>*/
+#ifndef _MFC_VER
+
+#include <osi.h>
+#include <afsint.h>
+
+#include <windows.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+#include <errno.h>
+#endif
+
+typedef short int16;
+typedef unsigned short u_int16;
+
+#ifdef _MFC_VER
+extern "C" {
+#endif
+#include <afs\fs_utils.h>
+#ifdef _MFC_VER
+ }
+#endif
+
+int ShutdownAfs()
+{
+ struct ViceIoctl blob;
+ int code;
+
+ blob.in_size = 0;
+ blob.out_size = 0;
+ code = pioctl(0, VIOC_SHUTDOWN, &blob, 0);
+
+ return code;
+}
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+/* api functions for access to AFS pioctl functions from windows gui */
+
+int ShutdownAfs();
--- /dev/null
+//cafs.h
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+//#define DOSTITLE "_AFS File System_"
+//#define DOSTITLEFINISH "Finished - _AFS File System_"
+#define DOSTITLE "AFS Client Console"
+#define DOSTITLEFINISH "Finished - AFS Client Console"
+#define APPTITLE "AFS"
+#define APPTITLEFINISH "Finished - AFSD"
+#ifdef _DEBUG
+#define CMDLINE "AFSD.PIF -startup"
+//#define CMDLINE ".//debug//AFSD.EXE -startup"
+#else
+#define CMDLINE "AFSD.EXE -startup"
+//#define CMDLINE "AFSD.PIF -startup"
+//#define CMDLINE "AFSD.EXE"
+#endif
+
+#ifndef __CAFS__
+#define __CAFS__
+#include "share.h"
+
+class CProgress
+{
+public:
+ CProgress(CWnd *wnd, UINT mode);
+ ~CProgress();
+ void Next();
+ void Finish();
+ void SetTitle(const char *,const char *,const char *);
+private:
+ CWnd *m_pWnd;
+};
+
+class CAfs
+{
+ friend CProgress;
+public:
+ const char * MountName(){return m_sMountName;}
+ CAfs(){m_sDosAppName=DOSTITLE;m_sMountName="";};
+ ~CAfs();
+ BOOL Mount(CString &msg,const char *drvLetter,const char *path);
+ BOOL Create(CString &msg,CString sCompName,PROCESS_INFORMATION &procInfo);
+ BOOL Authencate(CString &msg,const char * username,const char * password);
+ BOOL Dismount(CString &msg,const char * drive,BOOL force=FALSE);
+ BOOL StartExployer(CString &msg, const char *drive);
+ BOOL Shutdown(CString &msg);
+ BOOL Init(CWnd *,CString &);
+ UINT TestTokenTime(CString&);
+ BOOL ScanTokens(CString&);
+ HWND & GetLoadWindowHandle(){return m_hAfsLoad;}
+ void FinishProgress();
+ BOOL CheckNet(CString &);
+private:
+ CString m_sMountName;
+ static CString m_sDosAppName;
+ STARTUPINFO m_startUpInfo;
+ PROCESS_INFORMATION m_procProgBar;
+ static HWND m_hAfsLoad;
+ static HWND m_hAfsLoadFinish;
+ static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
+ static BOOL CALLBACK EnumWindowsProcShutdown(HWND hWnd, LPARAM lParam);
+ char m_cCell[256]; //cell name
+
+ DWORD m_dTokenEndTime;
+ CTimeSpan m_tTotalSpanTime;
+};
+
+#endif
+
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#ifndef __ENCRIPT__
+#define __ENCRIPT__
+#include <wincrypt.h>
+typedef BOOL (WINAPI * PCRYPTACQUIRECONTEXT)(HCRYPTPROV *,LPCTSTR,LPCTSTR,DWORD,DWORD);
+typedef BOOL (WINAPI * PCRYPTCREATEHASH)(HCRYPTPROV,ALG_ID,HCRYPTKEY,DWORD,HCRYPTHASH *);
+typedef BOOL (WINAPI * PCRYPTHASHDATA)(HCRYPTHASH,BYTE *,DWORD,DWORD);
+typedef BOOL (WINAPI * PCRYPTDERIVEKEY)(HCRYPTPROV,ALG_ID,HCRYPTHASH,DWORD,HCRYPTKEY *);
+typedef BOOL (WINAPI * PCRYPTENCRYPT)(HCRYPTKEY,HCRYPTHASH,BOOL,DWORD,BYTE *,DWORD *,DWORD);
+typedef BOOL (WINAPI * PCRYPTDECRYPT)(HCRYPTKEY,HCRYPTHASH,BOOL,DWORD,BYTE *,DWORD *);
+typedef BOOL (WINAPI * PCRYPTDESTROYHASH)(HCRYPTHASH);
+typedef BOOL (WINAPI * PCRYPTDESTROYKEY)(HCRYPTKEY);
+typedef BOOL (WINAPI * PCRYPTRELEASECONTEXT)(HCRYPTPROV,DWORD);
+
+
+class CEncript
+{
+public:
+ CEncript(CWinAfsLoadDlg *pParent);
+ ~CEncript();
+ CWinAfsLoadDlg *m_pParent;
+ BOOL Encript(LPCSTR pMachinename,LPCSTR pLoginName,LPCSTR pUsername,PBYTE pPassword,DWORD &dwSize,BOOL doEncript);
+ BOOL IsValid(){return (m_hLibrary!=NULL);}
+private:
+ HMODULE m_hLibrary;
+ PCRYPTACQUIRECONTEXT m_pCryptAcquireContext;
+ PCRYPTCREATEHASH m_pCryptCreateHash;
+ PCRYPTHASHDATA m_pCryptHashData;
+ PCRYPTDERIVEKEY m_pCryptDeriveKey;
+ PCRYPTENCRYPT m_pCryptEncrypt;
+ PCRYPTDECRYPT m_pCryptDecrypt;
+ PCRYPTDESTROYHASH m_pCryptDestroyHash;
+ PCRYPTDESTROYKEY m_pCryptDestroyKey;
+ PCRYPTRELEASECONTEXT m_pCryptReleaseContext;
+};
+
+#endif
\ No newline at end of file
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#include "StdAfx.h"
+#include "ModVer.h"
+
+CModuleVersion::CModuleVersion()
+{
+}
+
+//////////////////
+// Destroy: delete version info
+//
+CModuleVersion::~CModuleVersion()
+{
+}
+
+BOOL CModuleVersion::GetFileVersionInfo(LPCTSTR modulename,DWORD &vernum)
+{
+ vernum=0;
+ TCHAR filename[_MAX_PATH];
+ HMODULE hModule = ::GetModuleHandle(modulename);
+ DWORD dwHandle;
+ if (hModule==NULL && modulename!=NULL)
+ return FALSE;
+ DWORD len = GetModuleFileName(hModule, filename,
+ sizeof(filename)/sizeof(filename[0]));
+ if (len <= 0)
+ return FALSE;
+ len = GetFileVersionInfoSize(filename, &dwHandle);
+ if (len <= 0)
+ return FALSE;
+
+ BYTE * pVersionInfo = new BYTE[len]; // allocate version info
+ if (!::GetFileVersionInfo(filename, 0, len, pVersionInfo))
+ return FALSE;
+ VS_FIXEDFILEINFO *pfixed;
+ UINT iLen;
+ if (!VerQueryValue(pVersionInfo, _T("\\"), (LPVOID *)&pfixed, &iLen))
+ return FALSE;
+ vernum=pfixed->dwFileVersionMS;
+ delete pVersionInfo;
+ return pfixed->dwSignature == VS_FFI_SIGNATURE;
+}
+
+typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
+
+BOOL CModuleVersion::DllGetVersion(LPCTSTR modulename, DLLVERSIONINFO& dvi,DWORD &vernum)
+{
+ HINSTANCE hinst = LoadLibrary(modulename);
+ vernum=0;
+ if (!hinst)
+ return FALSE;
+
+ DLLGETVERSIONPROC pDllGetVersion =
+ (DLLGETVERSIONPROC)GetProcAddress(hinst, _T("DllGetVersion"));
+
+ if (!pDllGetVersion)
+ return FALSE;
+
+ memset(&dvi, 0, sizeof(dvi)); // clear
+ dvi.cbSize = sizeof(dvi); // set size for Windows
+ BOOL ret=SUCCEEDED((*pDllGetVersion)(&dvi));
+ vernum=MAKELONG(dvi.dwMinorVersion,dvi.dwMajorVersion);
+ return ret;
+}
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#ifndef __MODVER_H
+#define __MODVER_H
+
+#include <shlwapi.h> //win95/98/2000 sdk
+#define PACKVERSION(major,minor) MAKELONG(minor,major)
+
+// tell linker to link with version.lib for VerQueryValue, etc.
+#pragma comment(linker, "/defaultlib:version.lib")
+
+// CModuleVersion version info about a module.
+//
+
+class CModuleVersion {
+public:
+ CModuleVersion();
+ virtual ~CModuleVersion();
+ BOOL GetFileVersionInfo(LPCTSTR modulename,DWORD &vernum);
+ BOOL DllGetVersion(LPCTSTR modulename, DLLVERSIONINFO& dvi,DWORD &vernum);
+};
+
+#endif
+
--- /dev/null
+//{{NO_DEPENDENCIES}}
+// generated include file.
+// Used by WinAfsLoad.rc
+//
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#define IDM_ABOUTBOX 0x0010
+#define IDD_ABOUTBOX 100
+#define IDS_ABOUTBOX 101
+#define IDD_WINAFSLOAD_DIALOG 102
+#define IDP_SOCKETS_INIT_FAILED 103
+#define IDR_MAINFRAME 128
+#define IDR_TRAYICON 131
+#define IDD_ACTIVITYLOG 132
+#define IDD_AFSCHANGE 134
+#define IDD_DIALOGTERM 138
+#define IDD_DIALOGFORCE 140
+#define IDR_ACCELERATOR1 141
+#define IDD_DIALOGRETRY 143
+#define IDD_PROGBAR_DIALOG 145
+#define IDD_MENUSETTINGS 146
+#define IDB_WORLD 247
+#define IDD_SETTINGS 252
+#define IDC_CONNECT 1001
+#define IDC_CANCEL 1002
+#define IDS_HIDE 1003
+#define IDC_OPTIONLINE 1005
+#define IDC_PICTURE 1006
+#define IDC_EDIT 1007
+#define IDC_DRIVEMOUNTLIST 1008
+#define IDC_SETTINGS 1009
+#define IDC_CHECKADVANCED 1010
+#define IDC_USERNAME 1011
+#define IDC_PASSWORD 1012
+#define IDC_SAVEUSERNAME 1013
+#define IDC_SHOWLOG 1016
+#define IDC_ADD 1018
+#define IDC_CHANGE 1019
+#define IDC_REMOVE 1020
+#define IDS_DISCONNECT 1021
+#define IDS_HIDEADVANCE 1023
+#define IDC_MOUNTDISPLAY 1024
+#define IDS_HIDELOG 1024
+#define IDS_FORGETUSERNAME 1025
+#define IDC_DRIVE 1027
+#define IDC_STATICMSG 1029
+#define IDC_AUTH 1033
+#define IDC_SHOWBACK 1034
+#define IDC_STATICABOUT 1035
+#define IDC_CHECKBACKGROUND 1038
+#define IDC_TIMEBACKGROUND 1039
+#define IDC_CHECKAUTHENICATION 1040
+#define IDC_TIMEAUTHENICATION 1041
+#define IDC_PATH 1042
+#define IDC_CHECKMOUNT 1042
+#define IDC_PERSISTENT 1043
+#define IDC_TIMEMOUNT 1043
+#define IDC_DESCRIPTION 1044
+#define IDC_AUTHWARN 1046
+#define IDC_WORLD 1049
+#define IDM_CAPTUREWINDOW 1088
+#define IDM_CAPTUREFILE 1104
+#define IDM_VIEWAFS 1136
+#define IDH_ADD 1137
+#define IDH_CHANGE 1138
+#define IDH_MAIN 1140
+#define IDM_CLEAR 1152
+#define IDM_VISIBLE 1168
+#define IDC_COMPLETE_AUTH 1280
+#define IDC_COMPLETE_ENABLE 1281
+#define IDC_COMPLETE_MOUNT 1282
+#define IDC_STATUSREGION 1284
+#define IDC_FORCE 1285
+#define IDC_STATICOPTIONS 1286
+#define IDC_HELPMAIN 1287
+#define IDC_LOGTOFILE 1288
+#define IDC_LOGTOWINDOW 1290
+#define IDC_CONNECTONSTART 1291
+#define IDH_SETTINGS 1293
+#define IDM_EXPLORERAFS 1296
+#define IDC_MAXLOGINTIME 1362
+#define IDC_POWERRESTARTDELAY 1363
+#define IDC_BUTTON1 1365
+#define IDM_APP_OPEN 32771
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 253
+#define _APS_NEXT_COMMAND_VALUE 32774
+#define _APS_NEXT_CONTROL_VALUE 1366
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
--- /dev/null
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+#if !defined(SHARE_H__CF7462A3_F999_11D3_A374_00105A6BCA62__INCLUDED_)
+#define SHARE_H__CF7462A3_F999_11D3_A374_00105A6BCA62__INCLUDED_
+#define WM_MY_TRAY_NOTIFICATION WM_APP+1
+#define WM_DIRTIMER WM_USER+2 //MUST BE DIFFERENT FROM CTRAYICON
+#define WM_AUTTIMER WM_USER+3
+#define WM_PROGRESSTIMER WM_USER+4
+#define WM_PROGRESSPARM WM_USER+5 //SHARED BETWEEN PROGBAR
+#define WM_LOG WM_USER+6 //Message Log
+#define WSA_EVENT WM_USER+7 //Socket messages
+#define WM_UIONPARM WM_USER+8
+#define WM_UIPING WM_USER+9 //INDication from UIThread that there is a socket connection to server
+#define WM_UICONNECT WM_USER+10 //UIThread do a connect to socket
+#define WM_UIDISCONNECT WM_USER+11 //UIthread do a disconnect
+#define WM_PINGRETURN WM_USER+12 //return message from a ping
+#define WM_CONNECTRETURN WM_USER+13 //return message from connect
+#define WM_RESUMEDELAY WM_USER+14 //used to delay after power resume
+#define WM_ERRORMSG WM_USER+15 //Error Display Message
+#define ProgFShow 100 //since modes are 1-7 skip thoes numbers
+#define ProgFHide 102
+#define ProgFOpt 103
+#define ProgFNext 104
+#define ProgFSetTitle 105
+
+#define SOCKETIO 2000 //maximum IO time for sockets in milli-seconds
+
+#endif
install: $(INCFILES) $(LIBFILE)
+install9x: install
+
clean::
+ $(DEL) $(INCFILES)
\ No newline at end of file
${INSTALL} cellconfig.h ${DESTDIR}include/afs
${INSTALL} keys.h ${DESTDIR}include/afs
+includes: auth.h cellconfig.h keys.h
+ ${INSTALL} auth.h ${DESTDIR}include/afs
+ ${INSTALL} cellconfig.h ${DESTDIR}include/afs
+ ${INSTALL} keys.h ${DESTDIR}include/afs
+
clean:
rm -f *.o *.a copyauth testcellconf setkey auth.h cellconfig.h acfg_errors.c ktc_errors.c core\
AFS_component_version_number.c
$(DESTDIR)\lib\afs\afseventlog.lib \
$(EXELIBDIR)\afs\afsreg.lib
+
$(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
$(EXECONLINK)
$(EXEPREP)
install: $(INCFILES) $(AFSAUTH_LIBFILE) setkey.exe # $(COPYAUTH_EXEFILE) $(AFSAUTH_KRB_LIBFILE)
+install9x: install
+
clean::
$(DEL) acfg_errors.c ktc_errors.c
$(DEL) $(INCFILEDIR)\auth.h $(INCFILEDIR)\cellconfig.h
#include "cellconfig.h"
#include "keys.h"
+#ifdef AFS_DNS
+#include "DNS_AFS.h"
+#endif /* AFS_DNS */
+
static ParseHostLine();
static ParseCellLine();
static afsconf_OpenInternal();
/* lookup a service name */
struct servent *ts;
register struct afsconf_servPair *tsp;
+
#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
ts = getservbyname(aname, "");
#else
/* we found it in /etc/services, so we use this value */
return ts->s_port; /* already in network byte order */
}
+
/* not found in /etc/services, see if it is one of ours */
for(tsp = serviceTable;; tsp++) {
if (tsp->name == (char *) 0) return -1;
int cnLen, ambig;
char tbuffer[64];
+#ifdef AFS_DNS
+ /////////////////////////////////////////////
+ //TRY A DNS QUERY FOR THAT CELL FIRST!
+
+ struct afsconf_entry DNSce;
+ char *DNStmpStrp; /* a temp string pointer */
+ struct hostent *thp;
+
+
+ DNSce.cellInfo.numServers=0;
+ DNSce.next = NULL;
+ DNStmpStrp = getAFSServer(acellName);
+ while(DNStmpStrp != NULL) {
+ strcpy(DNSce.cellInfo.hostName[DNSce.cellInfo.numServers],DNStmpStrp);
+ thp = gethostbyname(DNStmpStrp);
+ if (!thp)
+ thp = DNSgetHostByName(DNStmpStrp);
+ if (thp) {
+ memcpy(&DNSce.cellInfo.hostAddr[DNSce.cellInfo.numServers].sin_addr.s_addr, thp->h_addr,
+ sizeof(long));
+ DNSce.cellInfo.hostAddr[DNSce.cellInfo.numServers].sin_family = AF_INET;
+ /* sin_port supplied by connection code */
+ }
+ DNSce.cellInfo.numServers++; /* add the server to the VLDB server list */
+ DNStmpStrp = getAFSServer(acellName);
+ };
+
+ if (DNSce.cellInfo.numServers>0) {
+ strcpy(&(DNSce.cellInfo.name),acellName);
+ *acellInfo = DNSce.cellInfo; /* structure assignment */
+ if (aservice) {
+ LOCK_GLOBAL_MUTEX
+ tservice = afsconf_FindService(aservice);
+ UNLOCK_GLOBAL_MUTEX
+ if (tservice < 0) {
+ return AFSCONF_NOTFOUND; /* service not found */
+ }
+ for(i=0;i<acellInfo->numServers;i++) {
+ acellInfo->hostAddr[i].sin_port = tservice;
+ }
+ };
+ return 0;
+ };
+ /////////////////////////////////////////////
+#endif /* AFS_DNS */
+
+
LOCK_GLOBAL_MUTEX
if (adir) afsconf_Check(adir);
if (acellName) {
* Instead of sending the session key in the clear, we zero it,
* and send it later, via RPC, encrypted.
*/
+#ifndef AFS_WIN95_ENV
/*
memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey));
*/
memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey));
+#else
+ memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey));
+#endif
ct.BeginTimestamp = token->startTime;
ct.EndTimestamp = token->endTime;
if (ct.BeginTimestamp == 0) ct.BeginTimestamp = 1;
memcpy(tp, &uuid, sizeof(uuid));
tp += sizeof(uuid);
+#ifndef AFS_WIN95_ENV
/* RPC to send session key */
status = send_key(uuid, token->sessionKey.data);
if (status != RPC_S_OK) {
else
return KTC_RPC;
}
+#endif /* AFS_WIN95_ENV */
/* set up for pioctl */
iob.in = tbuffer;
return KTC_PIOCTLFAIL;
}
+#ifndef AFS_WIN95_ENV /* get rid of RPC for win95 build */
/* RPC to receive session key */
status = receive_key(uuid, token->sessionKey.data);
if (status != RPC_S_OK) {
else
return KTC_RPC;
}
+#endif /* AFS_WIN95_ENV */
cp = tbuffer;
token->endTime = ct.EndTimestamp;
if (ct.AuthHandle == -1) ct.AuthHandle = 999;
token->kvno = ct.AuthHandle;
+#ifndef AFS_WIN95_ENV
/*
* Session key has already been set via RPC
*/
- /*
+#else
memcpy(&token->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
- */
+#endif /* AFS_WIN95_ENV */
token->ticketLen = ticketLen;
if (client) {
strcpy(client->name, cp);
libcmd64.a: ${LIB64OBJS} AFS_component_version_number64.o
-rm -f libcmd64.a
- ar r libcmd64.a ${LIB64OBJS} AFS_component_version_number64.o
+ $(AR) r libcmd64.a ${LIB64OBJS} AFS_component_version_number64.o
$(RANLIB) libcmd64.a
libcmd.a: ${LIBOBJS} AFS_component_version_number.o
-rm -f libcmd.a
- ar r libcmd.a ${LIBOBJS} AFS_component_version_number.o
+ $(AR) r libcmd.a ${LIBOBJS} AFS_component_version_number.o
$(RANLIB) libcmd.a
kinstall:
install: $(LIBFILE) $(INCFILES)
+install9x: install
clean::
$(DEL) cmd_errors.c
+ $(DEL) $(LIBFILE)
test tests:
# build and install the compile_et executable
COMPILE_ET_EXEFILE = $(DESTDIR)\bin\compile_et.exe
+prep:
+ $(DESTDIR)\bin\touch et_lex.lex_nt.c
+ $(DESTDIR)\bin\touch error_table_nt.c
+ @echo If you update et_lex.lex.l, to build correctly, you should delete error_table_nt.c
+
et_lex.lex_nt.c: et_lex.lex.l
- $(LEX) -t et_lex.lex.l > $@
-
+ $(LEX) -t et_lex.lex.l > $@
+
error_table_nt.c: et_lex.lex_nt.c error_table.y
$(YACC) -d -o $@ error_table.y
$(EXEPREP)
####################################################################
-install: $(INCFILES) $(COMERR_LIBFILE) $(COMPILE_ET_EXEFILE)
+install: prep $(INCFILES) $(COMERR_LIBFILE) $(COMPILE_ET_EXEFILE)
+
+install9x: install
clean::
- $(DEL) *~ \#* *.bak \
+ $(DEL) $(COMERR_LIBFILE)
+ $(DEL) $(COMPILE_ET_EXEFILE)
+ $(DEL) *~ *.bak \
*.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
*.cp *.fn *.ky *.log *.pg *.tp *.vr \
et.ar TAGS
*
*/
+#undef MEMORYLEAK
#include <afs/param.h>
#include <stdio.h>
static yyconst int yy_ec[256] =\r
{ 0,\r
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,\r
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\r
+ 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,\r
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\r
1, 2, 1, 4, 5, 1, 1, 1, 1, 1,\r
1, 1, 1, 1, 1, 1, 1, 6, 6, 6,\r
--- /dev/null
+#
+# Makefile.djgpp.common
+# shared make information for all builds
+# requires gmake
+#
+# Usage: Not designed for direct invocation.
+# Please use a Makefile.djgpp instead, which will include this file
+# as a resource.
+#
+# Makefile.djgpp
+# A Makefile should define some basics, be in the right directory, then
+# include this Makefile.djgpp.common
+# Please define
+# TARGETS a list of executables the Makefile covers (with .exe)
+# target rules dependencies between an executable and its object files
+# install target --- to be determined ---
+# all target list the exported files of the build
+
+#
+# VARIABLE SETUP
+#
+
+SHELL = /bin/sh
+MKDIR = /bin/mkdir -p
+CP = /bin/cp -f
+MAKE := $(MAKE) -f Makefile.djgpp
+
+.PHONY : install all clean depends
+# depends is a phony target even though we have a file by that name
+# to hold dependency information, because we want it to be refreshed every
+# time a user invokes make depends, regardless of how up-to-date it may appear
+
+# These are the source files that need make depends handling.
+#
+ifndef SOURCES
+SOURCES = $(wildcard *.c) $(wildcard *.s)
+endif
+
+# This define is for convenience only, should individual makefiles find
+# it useful to have a list of possible object files.
+#
+# ALL_OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) \
+# $(patsubst %.s,%.o,$(wildcard *.s))
+ALL_OBJS = $(addsuffix .o,$(basename $(SOURCES)))
+
+# These are the directories where built things should end up.
+#
+DESTINC = DEST/include
+DESTINCAFS = DEST/include/afs
+DESTLIB = DEST/lib
+DESTBIN = DEST/bin
+
+# global flags: Please set or empty these global flags as needed,
+# or append to/modify them in local makefiles for directory-specific behavior.
+#
+#DEBUGFLAGS = #-g #-pg
+ # -Wall
+DEBUGFLAGS = -g -DDEBUG
+#OPTIMIZEFLAGS = -O2
+#OPTIMIZEFLAGS =
+INCLUDES = -IDEST/include # -I../client_osi
+# includes2 is for compiling components in outer directory
+INCLUDES2 = -I../djgpp/include -I../djgpp/client_osi
+LIBDIRS = -L$(DESTLIB)
+DEFINES = -Dfds_bits=fd_bits
+# -DIDRIVE_X86_ENV
+
+# global flags: These are constructed from other defines.
+# Redefine global flags in individual makefiles if needed.
+#
+CFLAGS = $(DEBUGFLAGS) $(OPTIMIZEFLAGS) $(DEFINES) $(INCLUDES)
+CFLAGS2 = $(DEBUGFLAGS) $(OPTIMIZEFLAGS) $(DEFINES) $(INCLUDES2)
+LDFLAGS = $(DEBUGFLAGS) $(OPTIMIZEFLAGS) $(LIBDIRS)
+
+# We are cross-compiling, so some defaults change...
+#
+CC = dos-gcc -bmmap
+#CC = gcc -bmmap
+MAKEDEPEND = $(CC) $(CFLAGS) -M
+CPP = $(CC) $(CFLAGS) -E
+LD = dos-ld
+AS = dos-as
+AR = dos-ar
+RANLIB = $(AR) -s # GNU-ranlib = GNU-ar -s
+
+#
+# RULES FOR ESSENTIAL TARGETS
+#
+
+# make all
+# Builds the files that need to be built
+# Actual files to be built should be listed as dependencies
+# in the Makefile that includes this one.
+# A do-nothing target is listed here to ensure it is the first
+# (default) target.
+all :
+
+# make install
+# Installs the built files in the right place
+# Actual files in their final destinations should be listed
+# as dependencies in the makefile that includes this one.
+# For example, if install needs to copy libwidget.a to $DESTLIB,
+# the makefile should have a line 'install : $(DESTLIB)/libwidget.a'.
+# It may optionally have a body of commands that handle any
+# directory-specific post-processing.
+install : all
+
+# make depends
+# Updates dependencies for all source files
+# Must be run by hand whenever dependencies change, or before
+# the very first build
+#
+depends :
+ $(MAKEDEPEND) $(SOURCES) > Makefile.djgpp.depends
+
+# make clean
+# Removes all built files
+#
+clean :
+ -rm -f $(TARGETS) *.o *.ss core
+
+#
+# IMPLICIT RULES
+#
+
+# new implicit rules install files
+# These come first so that the more general rule to create libraries does not
+# trump the rule below to install libraries.
+#
+$(DESTLIB)/%.a : %.a
+ [ -d $(DESTLIB) ] || $(MKDIR) $(DESTLIB)
+ $(CP) $< $@
+#$(DESTLIB2)/%.a : %.a
+# [ -d $(DESTLIB2) ] || $(MKDIR) $(DESTLIB2)
+# $(CP) $< $@
+$(DESTINC)/%.h : %.h
+ [ -d $(DESTINC) ] || $(MKDIR) $(DESTINC)
+ $(CP) $< $@
+$(DESTINCAFS)/%.h : %.h
+ [ -d $(DESTINC) ] || $(MKDIR) $(DESTINC)
+ [ -d $(DESTINCAFS) ] || $(MKDIR) $(DESTINCAFS)
+ $(CP) $< $@
+# special: djgpp can make .exe and coff file pairs; copy both if possible
+$(DESTBIN)/%.exe : %.exe
+ [ -d $(DESTBIN) ] || $(MKDIR) $(DESTBIN)
+ -[ -r $(basename $<) ] && $(CP) $(basename $<) $(DESTBIN)/
+ $(CP) $^ $@
+
+# new implicit rules to handle assembly (.s), AFS-style
+# AFS uses %.s -> cpp -> %.ss -> as -> %.o rather than the
+# gmake %.S -> cpp -> %.s -> as -> %.o default.
+#
+%.ss : %.s
+ $(CPP) $(CPPFLAGS) -P -x c-header $< $(OUTPUT_OPTION)
+%.o : %.ss
+ $(AS) $(ASFLAGS) $< $(OUTPUT_OPTION)
+
+# new implicit rule to create libraries
+#
+%.a :
+ -$(RM) $@
+ $(AR) rv $@ $^
+ $(RANLIB) $@
+
+# new implicit rule to create executables
+# $(LD) $(LDFLAGS) $^ -o $(basename $@)
+%.exe :
+ $(CC) $(LDFLAGS) -Wl,-\( $^ -Wl,-\) -o $(basename $@)
+
+
+#
+# DEPENDENCY INFORMATION
+#
+
+# always request a local dependency list
+#
+ifeq ($(MAKECMDGOALS),depends)
+ DONTDEP=1
+endif
+ifeq ($(MAKECMDGOALS),includes)
+ DONTDEP=1
+endif
+ifneq ($(DONTDEP),1)
+include Makefile.djgpp.depends
+# ensure a build process breaks if Makefile.djgpp.depends does not exist
+#
+Makefile.djgpp.depends :
+ @echo Please run \"$(MAKE) depends\" to generate dependency information.
+ @exit 1
+endif
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+# Keep macros within each section in sorted order for clean diff displays.
+#
+# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+AFS_OSTYPE = DJGPP
+DESTDIR=DEST/
+SRCDIR=DEST/
+
+# compilation and link editor flags
+DBG=-g
+#OPTMZ=-O2
+#PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
+# Put -O2 here to _ensure_ all Makefiles pick it up.
+XCFLAGS= ${DBG} -Dfds_bits=fd_bits
+MT_CFLAGS=${XCFLAGS}
+XLDFLAGS=
+SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_SUFFIX=so
+SHLIB_CFLAGS=
+#
+# libraries
+MTLIBS=
+TXLIBS=
+XLIBS=
+#
+# programs
+AR=dos-ar
+AS=dos-as
+CP=cp
+INSTALL=${SRCDIR}bin/install
+LD=dos-ld
+CC=dos-gcc -bmmap
+RANLIB=dos-ranlib
+MT_CC=dos-gcc -bmmap
+MV=mv
+RM=rm
+WASHTOOL=${SRCDIR}bin/washtool
+#
+# Other OS specific requirements
+#
+YACC = bison -y
+LEX = flex -l
+# Used in des library.
+CRYPT_OBJ = crypt.o
!ERROR Can not find src directory from current directory.
!ENDIF
-
-
INCFILEDIR = $(DESTDIR)\include\afs
INCFILES =\
$(COPY) $? $@
idirs: doclink
+! IF (!EXIST($(DESTDIR)))
+ $(MKDIR) $(DESTDIR)
+! ENDIF
! IF (!EXIST($(DESTDIR)\include))
$(MKDIR) $(DESTDIR)\include
! ENDIF
! IF (!EXIST($(DESTDIR)\root.server\usr\afs\bin))
$(MKDIR) $(DESTDIR)\root.server\usr\afs\bin
! ENDIF
+! IF (!EXIST($(DESTDIR)\root.client))
+ $(MKDIR) $(DESTDIR)\root.client
+! ENDIF
+! IF (!EXIST($(DESTDIR)\root.client\usr))
+ $(MKDIR) $(DESTDIR)\root.client\usr
+! ENDIF
+! IF (!EXIST($(DESTDIR)\root.client\usr\vice))
+ $(MKDIR) $(DESTDIR)\root.client\usr\vice
+! ENDIF
! IF (!EXIST($(DESTDIR)\root.client\usr\vice\etc))
$(MKDIR) $(DESTDIR)\root.client\usr\vice\etc
! ENDIF
$(COPY) NTMakefile.version-NOCML NTMakefile.version
! ENDIF
+$(DESTDIR)\bin\util_cr.exe: util_cr.exe
+ $(COPY) util_cr.exe $(DESTDIR)\bin
+
+$(DESTDIR)\bin\touch.exe: touch.exe
+ $(COPY) touch.exe $(DESTDIR)\bin
+
$(DESTDIR)\bin\mkvers.exe: mkvers.exe
$(COPY) mkvers.exe $(DESTDIR)\bin
$(COPY) NTDllmap.txt $(DESTDIR)
-$(DESTDIR)\bin\NTLang.bat: NTLang.bat
+# $$$: make CR/LF when doing copy here
+$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe
$(COPY) NTLang.bat $(DESTDIR)\bin
+ util_cr + $(DESTDIR)\bin\NTLang.bat
-langsetup: $(DESTDIR)\bin\NTLang.bat
+util_cr.obj : util_cr.c
+ $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) $*.c
+util_cr.exe : util_cr.obj
+ $(EXECONLINK)
-install: idirs version $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup
+langsetup: $(DESTDIR)\bin\NTLang.bat
+
+install: idirs version $(DESTDIR)\bin\touch.exe $(DESTDIR)\bin\util_cr.exe $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup
+install9x: install
# This clean target must be named something different than the universal
# 'clean' so that the version file can be removed last.
clean_version:
$(DEL) NTMakefile.version
+
+clean::
+ $(DEL) $(DESTDIR)\LIB\*.DLL
+ $(DEL) $(DESTDIR)\bin\mkvers.exe
\ No newline at end of file
# Command macros.
COPY = copy
-DEL = del
+DEL = -del
MKDIR = mkdir
REN = ren
ECHO = echo
# Common clean target.
# Double colon (::) syntax allows supplemental clean target to be specified.
clean::
- $(DEL) *.obj *.lib *.dll *.exe
- $(DEL) *_component_version_number.*
+ $(DEL) /q *.obj *.lib *.dll *.exe
+ $(DEL) /q *_component_version_number.*
# Common lang target.
# Double colon (::) syntax allows supplemental lang target to be specified.
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+# Common nmake file to be included in each NTMakfile.
+#
+# Required definitions:
+# AFSDEV_BUILDTYPE = [ CHECKED | FREE ]
+# AFSDEV_INCLUDE = <default include directories>
+# AFSDEV_LIB = <default library directories>
+# AFSDEV_BIN = <default build binary directories>
+#
+# Optional definitions:
+# AFSDEV_DESTDIR = <top-level install directory> (default is $(AFSROOT)\DEST)
+# AFSDEV_WARNLEVEL = [0 | 1 | 2 | 3 | 4] (default is 3)
+# AFSDEV_AUXCDEFINES = <auxiliary C preprocessor defs> (default is null)
+# AFSDEV_AUXRCFLAGS = <auxiliary resource compiler flags> (default is null)
+# AFSDEV_TEXTMODE = <text mode is default if defined> (default is null)
+# AFSDEV_CRTDEBUG = <utilize debug C runtime if define> (default is null)
+#
+############################################################################
+
+
+# Definitions provided here are based on WIN32.MAK, a common nmake
+# file included with the MS SDK and MS VC distributions.
+# WIN32.MAK, and this nmake file, are targeted to the MSVC compiler;
+# port this nmake file if additional compiler support is required.
+
+# Define default target-type macros required by WIN32.MAK.
+# Allow them to be overriden in an NTMakefile or via an environment variable.
+
+!IFNDEF APPVER
+APPVER = 4.0
+!ENDIF
+
+!IFNDEF TARGETOS
+TARGETOS = WIN95
+#TARGETOS = WINNT
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IFNDEF _WIN32_IE
+_WIN32_IE = 0x0300
+!ENDIF
+
+# Check that build type is correctly specified.
+
+!IF (DEFINED(PROFILE) || DEFINED(TUNE))
+# Build type ignored when profiling or tuning.
+AFSDEV_BUILDTYPE = NONE
+
+!ELSE
+# Build type must be checked or free.
+!IF ("$(AFSDEV_BUILDTYPE)" != "CHECKED" && "$(AFSDEV_BUILDTYPE)" != "FREE")
+!ERROR Must define AFSDEV_BUILDTYPE to be CHECKED or FREE.
+!ENDIF
+
+!ENDIF
+
+# Limit default include and library directories to those specified for build.
+
+!IFNDEF AFSDEV_INCLUDE
+!ERROR Must define AFSDEV_INCLUDE to be the default include directories.
+!ENDIF
+
+!IF ((!DEFINED(INCLUDE)) && ([set INCLUDE=$(AFSDEV_INCLUDE)] != 0))
+# If env. var. INCLUDE not defined then macro assignment won't set it.
+!ERROR Failed setting environment variable INCLUDE.
+!ENDIF
+INCLUDE = $(AFSDEV_INCLUDE)
+
+
+!IFNDEF AFSDEV_LIB
+!ERROR Must define AFSDEV_LIB to be the default library directories.
+!ENDIF
+
+!IF ((!DEFINED(LIB)) && ([set LIB=$(AFSDEV_LIB)] != 0))
+# If env. var. LIB not defined then macro assignment won't set it.
+!ERROR Failed setting environment variable LIB.
+!ENDIF
+LIB = $(AFSDEV_LIB)
+
+
+# Put default build binary directories at front of path.
+
+!IFNDEF AFSDEV_BIN
+!ERROR Must define AFSDEV_BIN to be the default build binary directories.
+!ENDIF
+
+!IF ((!DEFINED(PATH)) && ([set PATH=$(AFSDEV_BIN)] != 0))
+# If env. var. PATH not defined then macro assignment won't set it.
+!ERROR Failed setting environment variable PATH.
+!ENDIF
+PATH = $(AFSDEV_BIN);$(PATH)
+
+
+# Undefine WIN32.MAK NODEBUG macro.
+# Always generate full debug info, unless profiling or tuning (see below).
+
+!UNDEF NODEBUG
+
+# Include WIN32.MAK nmake file
+
+!INCLUDE <WIN32.MAK>
+
+# Extend and/or supplement definitions in WIN32.MAK.
+
+# Standard install directory.
+!IFDEF AFSDEV_DESTDIR
+DESTDIR = $(AFSDEV_DESTDIR)
+!ELSE
+DESTDIR = $(AFSROOT)\DEST
+!ENDIF
+
+# Command macros.
+COPY = copy
+#DEL = del
+#DEL = rm -f # to delete multiple files on one command line
+DEL = $(AFSROOT)\src\rmbat # win 98 must use batch file
+MKDIR = mkdir
+REN = ren
+ECHO = echo
+CD = cd
+MC = mc -vcsU
+MAKECMD = nmake.exe
+
+
+
+COMPILE_ET = $(DESTDIR)\bin\compile_et
+RXGEN = $(DESTDIR)\bin\rxgen
+MIDL = midl
+
+# Common clean target.
+# Double colon (::) syntax allows supplemental clean target to be specified.
+clean::
+ $(DEL) *.obj *.lib *.dll *.exe
+ $(DEL) *_component_version_number.*
+
+# Common lang target.
+# Double colon (::) syntax allows supplemental lang target to be specified.
+lang::
+
+
+# Compiler include paths and preprocessor defines
+
+afscdefs =\
+ -I. \
+ -I$(DESTDIR)\include \
+ -I$(DESTDIR)\include\afs \
+ -I$(DESTDIR)\include\rx \
+ -DWIN32_LEAN_AND_MEAN \
+ -DSTRICT \
+ -D_WIN32_IE=0x0400
+
+! IF ((EXIST($(MSSDK)\include)) && (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" )))
+afscdefs=$(afscdefs) -I$(MSSDK)\include $(afscppdefs) \
+! ENDIF
+
+afscdefs = $(afscdefs) $(AFSDEV_AUXCDEFINES)
+
+#add a few defines for win9xpanel
+afscppdefs = -D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_WINNT" /D "_AFXDLL"
+
+# Compiler switches (except include paths and preprocessor defines)
+#
+# Note: if conflicting options are specified, rightmost option applies.
+#
+# /Oy- specifies no frame-pointer omission
+# /GF pool strings and place in read-only memory
+# /Gd use cdecl calling convention by default
+# /Gy enable function-level linking
+# /GX enable C++ exceptions (assumes extern C funcs never throw exceptions)
+# /Os favor small (over fast) code; seems to avoid 64-bit bugs in VC compiler
+
+afscflags =\
+ /Oy- \
+ /GF \
+ /Gd \
+ /Gy \
+ /GX \
+ /Os
+
+# Set optimization and debugging level based on build type.
+
+!IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
+# Apply full optimization; generate full debug info in obj.
+afscflags = $(afscflags) /Ox /Z7
+ldebug = $(ldebug) -debugtype:both
+cdebug = $(cdebug:-Od=) # avoid annoying override warning (D4025)
+
+!ELSEIF ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
+# Disable optimization; generate full debug info in obj.
+afscflags = $(afscflags) /Od /Z7
+ldebug = $(ldebug) -debugtype:both
+!ENDIF
+
+# Set compiler warning level
+
+!IFNDEF AFSDEV_WARNLEVEL
+AFSDEV_WARNLEVEL = 3
+!ELSE
+!IF ("$(AFSDEV_WARNLEVEL)" != "0" && \
+ "$(AFSDEV_WARNLEVEL)" != "1" && \
+ "$(AFSDEV_WARNLEVEL)" != "2" && \
+ "$(AFSDEV_WARNLEVEL)" != "3" && \
+ "$(AFSDEV_WARNLEVEL)" != "4")
+!ERROR Must define AFSDEV_WARNLEVEL to be one of 0 through 4.
+!ENDIF
+!ENDIF
+
+afscflags = $(afscflags) /W$(AFSDEV_WARNLEVEL)
+
+
+# Linker switches
+#
+# /FIXED:NO generates a relocation section in the executable
+
+afslflags =\
+ /FIXED:NO
+
+
+
+# For checked builds, define DEBUG (but not the MS control flag _DEBUG).
+
+!IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
+afscdefs = $(afscdefs) -DDEBUG
+!ENDIF
+
+# Utilize the debug version of the MSVC runtime, if requested.
+
+!IFDEF AFSDEV_CRTDEBUG
+afscdefs = $(afscdefs) -D_DEBUG
+conlibsdll = $(conlibsdll:msvcrt.lib=msvcrtd.lib)
+guilibsdll = $(guilibsdll:msvcrt.lib=msvcrtd.lib)
+!ENDIF
+
+# Link with binmode.obj; files will be opened in binary mode by default.
+
+!IFNDEF AFSDEV_TEXTMODE
+conlibsdll = $(conlibsdll) binmode.obj
+guilibsdll = $(guilibsdll) binmode.obj
+!ENDIF
+
+
+# Define MFC link and library macros
+# Note that MFC seems to make extensive use of default libraries,
+# thus we do not specify a general /NODEFAULTLIB.
+
+mfclflags = $(guilflags)
+mfclflags = $(mfclflags:/NODEFAULTLIB=)
+
+mfcdlllflags = $(dlllflags)
+mfcdlllflags = $(mfcdlllflags:/NODEFAULTLIB=)
+
+mfclibsdll = $(guilibsdll)
+mfclibsdll = $(mfclibsdll:msvcrtd.lib=)
+mfclibsdll = $(mfclibsdll:msvcrt.lib=)
+
+!IFNDEF AFSDEV_CRTDEBUG
+mfclflags = $(mfclflags) /NODEFAULTLIB:msvcrtd.lib
+mfcdlllflags = $(mfcdlllflags) /NODEFAULTLIB:msvcrtd.lib
+!ELSE
+mfclflags = $(mfclflags) /NODEFAULTLIB:msvcrt.lib
+mfcdlllflags = $(mfcdlllflags) /NODEFAULTLIB:msvcrt.lib
+!ENDIF
+
+
+# Macros for creating/modifying binary targets
+
+# EXE link macro for console applications
+EXECONLINK = $(link) /OUT:$@ $(ldebug) $(conlflags) $(afslflags) $(conlibsdll) $**
+
+# EXE link macro for GUI applications
+EXEGUILINK = $(link) /OUT:$@ $(ldebug) $(guilflags) $(afslflags) $(guilibsdll) $**
+
+# EXE link macro for MFC applications
+EXEMFCLINK = $(link) /OUT:$@ $(ldebug) $(mfclflags) $(afslflags) $(mfclibsdll) $**
+
+# DLL link macro for console applications
+DLLCONLINK = $(link) /OUT:$@ $(ldebug) $(dlllflags) $(afslflags) $(conlibsdll) $**
+
+# DLL link macro for GUI applications
+DLLGUILINK = $(link) /OUT:$@ $(ldebug) $(dlllflags) $(afslflags) $(guilibsdll) $**
+
+# DLL link macro for MFC applications
+DLLMFCLINK = $(link) /OUT:$@ $(ldebug) $(mfcdlllflags) $(afslflags) $(mfclibsdll) $**
+
+# DLL link macro for resource-only DLLs
+DLLRESLINK = $(link) /OUT:$@ $(dlllflags:-entry:_DllMainCRTStartup@12=-noentry) $(afslflags) $**
+
+# Library archive macro
+LIBARCH = $(implib) /NOLOGO /OUT:$@ $**
+
+# Language selection macro
+NTLANG = $(DESTDIR)\bin\NTLang.bat
+
+
+# EXE\DLL preparation macros
+# Rebase to avoid conflicts; strip symbols in free build.
+!IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
+EXEPREP = rebase -b 0x00400000 -x $(@D) -q $@
+DLLPREP = rebase -i $(DESTDIR)\NTDllmap.txt -x $(@D) -q $@
+!ELSEIF ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
+EXEPREP = rebase -b 0x00400000 -q $@
+DLLPREP = rebase -i $(DESTDIR)\NTDllmap.txt -q $@
+!ENDIF
+
+# C/C++ compilation macros
+
+C2OBJ = $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) /c
+CPP2OBJ = $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) $(afscppdefs) /c
+
+# Resource compiler macro
+RC = $(rc) $(rcvars) $(rcflags) $(AFSDEV_AUXRCFLAGS)
+
+# Lex/Yacc macros
+LEX = flex -l
+YACC = bison
+
+# Inference rules for building and installing targets
+
+# Compile .c files
+.c.obj:
+ $(C2OBJ) $*.c
+
+# Compile .cpp files
+.cpp.obj:
+ $(CPP2OBJ) $*.cpp
+
+# Compile .rc (resource) files
+.rc.res:
+ $(RC) $*.rc
+
+# Install header files
+.SUFFIXES: .h
+
+.h.{$(DESTDIR)\include}.h:
+ $(COPY) $(*B).h $(DESTDIR)\include
+
+.h.{$(DESTDIR)\include\afs}.h:
+ $(COPY) $(*B).h $(DESTDIR)\include\afs
+
+.h.{$(DESTDIR)\include\rx}.h:
+ $(COPY) $(*B).h $(DESTDIR)\include\rx
+
+.h.{$(DESTDIR)\include\WINNT}.h:
+ $(COPY) $(*B).h $(DESTDIR)\include\WINNT
+
#define SYS_NAME_ID_ncrx86_30 1301
#define SYS_NAME_ID_i386_nt35 1400
+#define SYS_NAME_ID_i386_win95 1401
#define SYS_NAME_ID_i386_linux2 1500
#define SYS_NAME_ID_i386_linux22 1501
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef _PARAM_I386_DJGPP_H_
+#define _PARAM_I386_DJGPP_H_
+
+#define AFS_NONFSTRANS
+#define AFS_DJGPP_ENV /* win95 env. */
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+
+/* Machine / Operating system information */
+#define SYS_NAME "i386_win9x"
+#define SYS_NAME_ID SYS_NAME_ID_i386_win9x
+#define AFSLITTLE_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#endif /* _PARAM_I386_DJGPP_H_ */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef _PARAM_USR_I386_LINUX22_H_
+#define _PARAM_USR_I386_LINUX22_H_
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define UKERNEL 1 /* user space kernel */
+#define AFS_ENV 1
+#define AFS_USR_LINUX20_ENV 1
+#define AFS_USR_LINUX22_ENV 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+
+/* Machine / Operating system information */
+#define SYS_NAME "i386_linux22"
+#define SYS_NAME_ID SYS_NAME_ID_i386_linux22
+#define AFSLITTLE_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_fmode uio_fmode
+#define afsio_resid uio_resid
+#define AFS_UIOSYS 1
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES MCLBYTES
+#define AFS_MINCHANGE 2
+#define VATTR_NULL usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#endif /* _PARAM_USR_I386_LINUX22_H_ */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef _PARAM_WIN95_H_
+#define _PARAM_WIN95_H_
+
+
+#define AFS_NT40_ENV 1
+#define AFSLITTLE_ENDIAN 1
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_WIN95_ENV 1
+
+#include <afs/afs_sysnames.h>
+#define SYS_NAME_ID SYS_NAME_ID_i386_win95
+
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+
+/*
+ * NT makes size_t a typedef for unsigned int (e.g. in <stddef.h>)
+ * and has no typedef for ssize_t (a signed size_t).
+ * So, we make our own.
+ */
+typedef int ssize_t;
+
+/* these macros define Unix-style functions missing in VC++5.0/NT4.0 */
+#define MAXPATHLEN _MAX_PATH
+
+#define bzero(A, S) memset((void*)(A), 0, (size_t)(S))
+#define bcopy(A, B, S) memcpy((void*)(B), (void*)(A), (size_t)(S))
+/* There is a minor syntactic difference between memcmp and bcmp... */
+#define bcmp(A,B,S) (memcmp((void*)(A), (void*)(B), (size_t)(S)) ? 1 : 0)
+#define strcasecmp(s1,s2) _stricmp(s1,s2)
+#define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
+#define index(s, c) strchr(s, c)
+#define rindex(s, c) strrchr(s, c)
+#define sleep(seconds) Sleep((seconds) * 1000)
+#define fsync(fileno) _commit(fileno)
+#define ftruncate(fd, size) _chsize((fd), (long)(size))
+#define strtoll(str, cp, base) strtoi64((str), (cp), (base))
+#define strtoull(str, cp, base) strtoui64((str), (cp), (base))
+
+#define random() rand()
+#define srandom(a) srand(a)
+
+#define popen(cmd, mode) _popen((cmd), (mode))
+#define pclose(stream) _pclose(stream)
+typedef char * caddr_t;
+
+#define pipe(fdp) _pipe(fdp, 4096, _O_BINARY)
+#endif /* _PARAM_WIN95_H_ */
--- /dev/null
+/* touch.c : Defines the entry point for the console application.*/
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#include "io.h"
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <process.h>
+
+void usuage()
+{
+ printf("touch filename/Wildcard \n");
+ exit(1);
+}
+
+int main(int argc, char* argv[])
+{
+ int fh,fs;
+ long pos;
+ char buffer[1];
+ struct _finddata_t finfo;
+ if (argc<2)
+ usuage();
+ fs=_findfirst(argv[1],&finfo);
+ if (fs==-1)
+ return 0;
+ do {
+
+ if ((finfo.attrib & ~_A_ARCH) != _A_NORMAL) continue;
+ fh=_open(finfo.name,_S_IWRITE|_O_BINARY|_S_IREAD|_O_RDWR);
+ pos=_lseek(fh,0l,SEEK_END);
+ _write(fh,buffer,1);
+ _chsize(fh,pos);
+ _close(fh);
+ } while (_findnext(fs,&finfo)==0);
+ return 0;
+}
--- /dev/null
+/* crlf.c : Defines the entry point for the console application.*/
+
+/* Copyright 2000, International Business Machines Corporation and others.
+ All Rights Reserved.
+
+ This software has been released under the terms of the IBM Public
+ License. For details, see the LICENSE file in the top-level source
+ directory or online at http://www.openafs.org/dl/license10.html
+*/
+
+#include "stdio.h"
+#include "io.h"
+#include "string.h"
+#include "process.h"
+#include "windows.h"
+#include "malloc.h"
+
+void usuage()
+{
+ printf("util_cr file ;remove cr (from crlf)\n\
+ OR util_cr + file ;add cr\n \
+ OR util_cr * \"+[register key value] x=y\" ; add register key value\n\
+ OR util_cr * \"-[register key value]\" ; aremove register key value\n\
+ OR util_cr & file.ini \"SectionKey=value\" ; update ini-ipr-pwf file\n\
+ OR util_cr ~ ;force error\n");
+ exit(1);
+}
+
+
+void Addkey (const char *hkey,const char *subkey,const char *stag,const char *sval)
+{
+ DWORD disposition,result;
+ HKEY kPkey,kHkey=0;
+ if (strcmp(hkey,"HKEY_CLASSES_ROOT")==0) kHkey=HKEY_CLASSES_ROOT;
+ if (strcmp(hkey,"HKEY_CURRENT_USER")==0) kHkey=HKEY_CURRENT_USER;
+ if (strcmp(hkey,"HKEY_LOCAL_MACHINE")==0) kHkey=HKEY_LOCAL_MACHINE;
+ if (kHkey==0)
+ usuage();
+ result=(RegCreateKeyEx(kHkey /*HKEY_LOCAL_MACHINE*/
+ ,subkey
+ ,0,NULL
+ ,REG_OPTION_NON_VOLATILE
+ ,KEY_ALL_ACCESS,NULL
+ ,&kPkey
+ ,&disposition)==ERROR_SUCCESS);
+ if(!result)
+ {
+ printf("AFS Error - Could Not create a registration key\n");
+ exit(1);
+ }
+ if (stag==NULL) return;
+ if ((sval)&&(strlen(sval)))
+ {
+ if (*stag=='@')
+ result=RegSetValueEx(kPkey,"",0,REG_SZ,(CONST BYTE *)sval,strlen(sval));
+ else
+ result=RegSetValueEx(kPkey,stag,0,REG_SZ,(CONST BYTE *)sval,strlen(sval));
+ } else {
+
+ if (*stag=='@')
+ result=(RegSetValueEx(kPkey,"",0,REG_SZ,(CONST BYTE *)"",0));
+ else
+ result=(RegSetValueEx(kPkey,stag,0,REG_SZ,(CONST BYTE *)"",0));
+ }
+ if(result!=ERROR_SUCCESS)
+ {
+ printf("AFS Error - Could Not create a registration key\n");
+ exit(1);
+ }
+}
+
+void Subkey(const char *hkey,const char *subkey)
+{
+ DWORD result;
+ HKEY kHkey=0;
+ if (strcmp(hkey,"HKEY_CLASSES_ROOT")==0) kHkey=HKEY_CLASSES_ROOT;
+ if (strcmp(hkey,"HKEY_CURRENT_USER")==0) kHkey=HKEY_CURRENT_USER;
+ if (strcmp(hkey,"HKEY_LOCAL_MACHINE")==0) kHkey=HKEY_LOCAL_MACHINE;
+ if (kHkey==0)
+ usuage();
+ result=RegDeleteKey(
+ kHkey,
+ subkey
+ );
+ if(result!=ERROR_SUCCESS)
+ {
+ printf("AFS Error - Could Not create a registration key\n");
+ exit(1);
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ char fname[128];
+ FILE *file;
+ int l,i;
+ char **pvar,*ch;
+ long len;
+ typedef char * CHARP;
+
+ if (argc<3)
+ usuage();
+ if (strcmp(argv[1],"~")==0)
+ {
+ exit(2);
+ }
+ if (strcmp(argv[1],"*")==0)
+ { /* "[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}] @=AFS Client Shell Extension" */
+ if (argc<3)
+ usuage();
+ for (i=2;argc>=3;i++)
+ {
+ char *ssub=strtok(argv[i],"[");
+ BOOL option;
+ char *skey=strtok(NULL,"]");
+ char *sval,*stag;
+ if ((ssub==NULL) || (skey==NULL))
+ {
+ printf("format error parameter %s\n",argv[i]);
+ exit(1);
+ }
+ option=(*ssub=='-');
+ stag=strtok(NULL,"\0");
+ if (stag)
+ while(*stag==' ')
+ stag++;
+ ssub=strtok(skey,"\\");
+ ssub=strtok(NULL,"\0");
+ sval=strtok(stag,"=");
+ sval=strtok(NULL,"\0");
+ switch (option)
+ {
+ case 0:
+ Addkey (skey,ssub,stag,sval);
+ break;
+ default :
+ if (stag)
+ Addkey (skey,ssub,stag,"");
+ else
+ Subkey(skey,ssub);
+ break;
+ }
+
+ argc-=1;
+ }
+ return 0;
+ }
+ if (strcmp(argv[1],"&")==0)
+ {
+ if (argc<4)
+ usuage();
+ for (i=3;argc>=4;i++)
+ {
+ char *ssect=strtok(argv[i],"[");
+ char *skey=strtok(argv[i],"]");
+ char *sval;
+ skey=strtok(NULL,"=");
+ if ((ssect==NULL) || (skey==NULL))
+ {
+ printf("format error parameter %s\n",argv[i]);
+ exit(1);
+ }
+ while(*skey==' ')
+ skey++;
+
+ sval=strtok(NULL,"=");
+ if (sval==NULL)
+ {
+ printf("format error parameter %s\n",argv[i]);
+ exit(1);
+ }
+ printf("parameters %s %s %s %s\n",ssect,skey,sval,argv[2]);
+ if (WritePrivateProfileString(ssect,skey,sval,argv[2])==0)
+ {
+ LPVOID lpMsgBuf;
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL
+ );
+ printf("Error writing profile string - %s",lpMsgBuf);
+ LocalFree( lpMsgBuf );
+ exit(1);
+ }
+ argc-=1;
+ }
+ return 0;
+ }
+ strcpy(fname,argv[2]);
+ if (strcmp(argv[1],"+")==0)
+ {
+ file=fopen(fname,"rb");
+ if (file==NULL)
+ exit(2);
+ len=filelength(_fileno(file));
+ ch=(char *)malloc(len+2);
+ *ch++=0; /* a small hack to allow matching /r/n if /n is first character*/
+ len=fread(ch,sizeof(char),len,file);
+ file=freopen(fname,"wb",file);
+ while (len-->0)
+ {
+ if ((*ch=='\n') && (*(ch-1)!='\r')) /*line feed alone*/
+ {
+ fputc('\r',file);
+ }
+ fputc(*ch,file);
+ ch++;
+ }
+ fclose(file);
+ return 0;
+ }
+ if (strcmp(argv[1],"-")==0)
+ {
+ strcpy(fname,argv[2]);
+ file=fopen(fname,"rb");
+ if (file==NULL)
+ exit(2);
+ len=filelength(_fileno(file));
+ ch=(char *)malloc(len+1);
+ len=fread(ch,sizeof(char),len,file);
+ file=freopen(fname,"wb",file);
+ while (len-->0)
+ {
+ if (*ch!='\r')
+ fputc(*ch,file);
+ ch++;
+ }
+ fclose(file);
+ return 0;
+ }
+ if (strstr(fname,".et")==NULL)
+ strcat(fname,".et");
+ file=fopen(fname,"rb");
+ if (file==NULL)
+ exit(2);
+ len=filelength(_fileno(file));
+ ch=(char *)malloc(len+1);
+ len=fread(ch,sizeof(char),len,file);
+ file=freopen(fname,"wb",file);
+ while (len-->0)
+ {
+ if (*ch!='\r')
+ fputc(*ch,file);
+ ch++;
+ }
+ fclose(file);
+ pvar=(CHARP *)malloc(argc*sizeof(CHARP));
+ for (i=1;i<argc-1;i++)
+ pvar[i]=argv[i+1];
+ pvar[argc-1]=NULL;
+ pvar[0]=argv[1];
+ l=_spawnvp(_P_WAIT,argv[1],pvar);
+ if (ch)
+ free(ch);
+ if (pvar)
+ free(pvar);
+ return 0;
+}
make_p_table \
make_s_table \
make_odd \
- make_e \
make_p \
make_s \
make_fp \
- make_ip \
- misc
+ make_ip
+
+XGPROGS = \
+ misc \
+ make_e
# Library component lists.
all: ${GFILES} ${CFILES} ${DEP_LIBS}
+gprogs: ${GPROGS}
+
test:
cd test; $(MAKE)
${INSTALL} $? $@
install install.noversion: all ukinstall ${DESTDIR}lib/libdes.a
- ${INSTALL} des.h des_conf.h mit-cpyright.h ${DESTDIR}include
+ ${INSTALL} des.h des_conf.h mit-cpyright.h crypt.h ${DESTDIR}include
${INSTALL} odd.h ${DESTDIR}include/des_odd.h
clean:
strng_to_key.o: mit-cpyright.h
strng_to_key.o: des_conf.h ./odd.h
debug_decl.o: debug_decl.c
+make_e.o: make_e.c
make_keyperm.o:
${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_keyperm.c
make_ip.o:
${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/strng_to_key.c
debug_decl.o:
${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/debug_decl.c
+make_e.o:
+ ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_e.c
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY (see make depend above)
$(EXECONLINK)
install: $(GENERATED_FILES) $(LIBFILE) $(INCFILES)
+
+install9x: install
+
+clean::
+ $(DEL) $(LIBFILE)
\ No newline at end of file
#ifdef AFS_NT40_ENV
#include "conf-winnt.h"
#else
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DJGPP_ENV)
#ifdef AFS_PPC_LINUX20_ENV
#include "conf-ppc-linux.h"
#else
*
* Note: this routine calls des_set_random_generator_seed.
*/
-#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
+#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_DJGPP_ENV)
you lose... (aka, you get to implement an analog of this for your
system...)
#else
* use a host id and process id in generating the seed to ensure
* that different servers have different streams:
*/
-#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
seed.host_id = gethostid();
#endif
seed.process_id = getpid();
install: $(LIBFILES) $(INCFILES)
clean::
+ $(DEL) $(DESPAR)\lib\afsdes.lib
\ No newline at end of file
libafsint.a: ${OBJS} AFS_component_version_number.o
-rm -f $@
- ar rv $@ ${OBJS} AFS_component_version_number.o
+ $(AR) rv $@ ${OBJS} AFS_component_version_number.o
$(RANLIB) $@
afsaux.o: afsaux.c afsint.h
# directory or online at http://www.openafs.org/dl/license10.html
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
+!IF (EXIST(..\config\NTMakefile.version))
!INCLUDE ..\config\NTMakefile.version
+!ENDIF
# Definitions for installing header files
install: $(LIBFILE) $(INCFILES) $(MT_LIBFILE)
+install9x: install
+
clean::
$(DEL) *.cs.c *.ss.c *.xdr.c afsint.h afscbint.h
# Override default definitions in NTMakefile.$(SYS_NAME) before including.
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!include ..\config\NTMakefile.version
############################################################################
kpwvalid.exe rebuild.exe \
$(DESTDIR)\etc\kas.exe
+install9X: $(INCFILES) $(KAUTH_LIBFILE) $(KAUTH_KRB_LIBFILE) \
+ $(KPASSWD_EXEFILE)
+
# installation targets that depend on local targets
$(DESTDIR)\etc\kas.exe: $(DESTDIR)\root.server\usr\afs\bin\kas.exe
$(COPY) $(DESTDIR)\root.server\usr\afs\bin\kas.exe \
# Local clean target; augments predefined clean target
clean::
-
+ $(DEL) $(KPASSWD_EXEFILE)
char cell[MAXKTCREALMLEN]
);
+#ifdef _MFC_VER
+extern "C" {
+#endif /* _MFC_VER */
extern afs_int32 ka_Init(
int flags
);
+#ifdef _MFC_VER
+}
+#endif /* _MFC_VER */
extern int ka_CellConfig (
char *dir
install: $(LIBFILE)
-clean::
+install9x: install
+clean::
+ $(DEL) $(INCFILES)
############################################################################
# Auxiliary build targets not built by default; e.g. test programs
# directory or online at http://www.openafs.org/dl/license10.html
!include ..\config\NTMakefile.$(SYS_NAME)
-
!include ..\config\NTMakefile.version
INCFILEDIR = $(DESTDIR)\include\afs
install: $(INCFILES)
+install9x: install
+
+clean::
+ $(DEL) $(INCFILES)
#include <afs/afs_Admin.h>
#include <time.h>
#ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
#include <winsock2.h>
+#endif /* _MFC_VER */
#endif
#define KAS_MAX_NAME_LEN 64
#include <afs/afs_Admin.h>
#include <sys/types.h>
#ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
#include <winsock2.h>
+#endif /* _MFC_VER */
#else
#include <sys/socket.h>
#endif
cm_config.obj: $(WINNTAFSD)\cm_config.c
$(C2OBJ) $(WINNTAFSD)\cm_config.c
-install: $(DESTDIR)\lib\afsauthent.dll
-
DLLLIBS =\
+!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+ $(DESTDIR)\lib\win95\pthread.lib \
+!ELSE
$(DESTDIR)\lib\pthread.lib \
+!ENDIF
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afsdes.lib \
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\afseventlog.lib
-$(DESTDIR)\lib\afsauthent.dll: $(DLLOBJS) $(DLLLIBS)
+$(LIBFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib
$(DLLPREP)
# Definitions for generating versioninfo resources
afsauthent.res: afsauthent.rc AFS_component_version_number.h
$(RC) $*.rc
+
+install: $(LIBFILE)
+
+install9x: install
+
+clean ::
+ $(DEL) $(LIBFILE)
\ No newline at end of file
# directory or online at http://www.openafs.org/dl/license10.html
!include ..\config\NTMakefile.$(SYS_NAME)
-
!include ..\config\NTMakefile.version
RX = ..\rx
DLLLIBS =\
+!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+ $(DESTDIR)\lib\win95\pthread.lib \
+!ELSE
$(DESTDIR)\lib\pthread.lib \
+!ENDIF
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afs\afsreg.lib
$(NTMAKE) libstub
! endif
+install9x: install
+
!IF (EXIST(..\..\src\des\NTMakefile))
!ELSE IF (EXIST(..\..\DESLIB))
DESPAR = ..\..\DESLIB\dest
$(DESTDIR)\lib\afsrpc.lib
$(COPY) $(DESPAR)\lib\afsrpc.exp \
$(DESTDIR)\lib\afsrpc.exp
+
+clean::
+ $(DEL) $(DESTDIR)\lib\afsrpc.dll $(DESTDIR)\lib\afsrpc.lib $(DESTDIR)\lib\afsrpc.exp
\ No newline at end of file
#
liblwp.a : ${LIBOBJS}
-rm -f liblwp.a
- ar rv liblwp.a ${LIBOBJS}
+ $(AR) rv liblwp.a ${LIBOBJS}
$(RANLIB) liblwp.a
libtlwp.a : ${LIBTOBJS}
-rm -f libtlwp.a
- ar rv libtlwp.a ${LIBTOBJS}
+ $(AR) rv libtlwp.a ${LIBTOBJS}
$(RANLIB) libtlwp.a
tlwp.o: lwp.c lwp.h
beancount:
wc -l *.[ch]
+
+includes:
+ ${INSTALL} *.h ${DESTDIR}include
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+# nmake Makefile for NT build of LWP.
+
+!include ..\config\NTMakefile.$(SYS_NAME)
+!IF (EXIST(..\config\NTMakefile.version))
+!include ..\config\NTMakefile.version
+!ENDIF
+
+#LIBOBJS = lock.obj \
+ #lwp_nt.obj \
+ #iomgr.obj \
+ #timer.obj\
+ #fasttime.obj \
+ #waitkey.obj \
+ #AFS_component_version_number.obj
+LIBOBJS=tlwp.obj process.obj lock.obj tiomgr.obj timer.obj fasttime.obj preempt.obj AFS_component_version_number.obj pthread.obj
+
+#tlwp.o: lwp.c lwp.h
+ #$(CC) $(CFLAGS) -DUSE_SOLARIS_THREADSX -c lwp.c
+ #mv lwp.o tlwp.o
+#
+#tiomgr.o: iomgr.c lwp.h
+# $(CC) $(CFLAGS) -DUSE_SOLARIS_THREADSX -c iomgr.c
+# mv iomgr.o tiomgr.o
+#
+#pthread.o : pthread.c
+# $(CC) $(CFLAGS) -DUSE_SOLARIS_THREADSX -c pthread.c
+
+LIBFILE = $(DESTDIR)\lib\afslwp.lib
+
+INCFILES = \
+ $(DESTDIR)\include\lock.h \
+ $(DESTDIR)\include\lwp.h \
+ $(DESTDIR)\include\preempt.h \
+ $(DESTDIR)\include\timer.h
+
+
+
+install: $(LIBFILE) $(INCFILES)
+
+$(LIBFILE): $(LIBOBJS)
+ $(LIBARCH)
+
+tests: rw.exe
+
+rw.exe: rw.obj $(LIBFILE) $(DESTDIR)\lib\afs\afsutil.lib
+ $(EXECONLINK)
install: $(LIBFILE) $(INCFILES)
+install9x: install
+
$(LIBFILE): $(LIBOBJS)
$(LIBARCH)
rw.exe: rw.obj $(LIBFILE) $(DESTDIR)\lib\afs\afsutil.lib
$(EXECONLINK)
+
+clean::
+ $(DEL) $(LIBFILE)
#ifdef AFS_SUN5_ENV
#include <fcntl.h>
#endif
+#ifdef AFS_DJGPP_ENV
+#include "dosdefs95.h"
+#include "netbios95.h"
+#include <sys/socket.h>
+#include <sys/farptr.h>
+#include <dpmi.h>
+#include <go32.h>
+#include <crt0.h>
+int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
+#endif /* AFS_DJGPP_ENV */
+
#if defined(USE_PTHREADS) || defined(USE_SOLARIS_THREADS)
void IOMGR_Initialize() /* noop */
#define MIN(a,b) ((a)>(b)) ? b : a
#endif
+#ifndef NSIG
+#define NSIG 8*sizeof(sigset_t)
+#endif
+
static int SignalSignals();
\f
/********************************\
/* Result of select call */
long result;
+#ifdef AFS_DJGPP_ENV
+ NCB *ncbp;
+ dos_ptr dos_ncb;
+#endif /* AFS_DJGPP_ENV */
+
};
\f
/********************************\
static void SignalIO(int fds, fd_set *rfds, fd_set *wfds, fd_set *efs,
int code);
+#ifdef AFS_DJGPP_ENV
+/* handle Netbios NCB completion */
+static int NCB_fd;
+int anyNCBComplete = FALSE;
+int handler_seg, handler_off; /* seg:off of NCB completion handler */
+static __dpmi_regs callback_regs;
+static _go32_dpmi_seginfo callback_info;
+#endif /* AFS_DJGPP_ENV */
+
/* fd_set pool managment.
* Use the pool instead of creating fd_set's on the stack. fd_set's can be
* 2K in size, so making three could put 6K in the limited space of an LWP
/* Note: SignalSignals() may yield! */
if (anySigsDelivered && SignalSignals ())
woke_someone = TRUE;
+#ifndef AFS_DJGPP_ENV
FT_GetTimeOfDay(&junk, 0); /* force accurate time check */
+#endif
TM_Rescan(Requests);
for (;;) {
register struct IoRequest *req;
LWP_QSignal(req->pid);
req->pid->iomgrRequest = 0;
}
+
+#ifdef AFS_DJGPP_ENV
+ if (IOMGR_CheckNCB()) /* check for completed netbios requests */
+ woke_someone = TRUE;
+#endif /* AFS_DJGPP_ENV */
+
if (woke_someone) LWP_DispatchProcess();
} while (woke_someone);
}
#endif /* NT40 */
+#ifdef AFS_DJGPP_ENV
+ /* We do this also for the DOS-box Win95 client, since
+ NCB calls don't interrupt a select, but we want to catch them
+ in a reasonable amount of time (say, half a second). */
+ iomgr_timeout.tv_sec = 0;
+ iomgr_timeout.tv_usec = IOMGR_WIN95WAITTIME;
+#endif /* DJGPP */
+
/* Check one last time for a signal delivery. If one comes after
this, the signal handler will set iomgr_timeout to zero, causing
the select to return immediately. The timer package won't return
if (anySigsDelivered)
continue; /* go to the top and handle them. */
+#ifdef AFS_DJGPP_ENV
+ if (IOMGR_CheckNCB()) /* check for completed netbios requests */
+ LWP_DispatchProcess();
+#endif /* AFS_DJGPP_ENV */
+
#ifdef AFS_NT40_ENV
if (IOMGR_readfds.fd_count == 0 && IOMGR_writefds.fd_count == 0
&& IOMGR_exceptfds.fd_count == 0) {
continue;
}
#endif /* AFS_NT40_ENV */
-
+#ifndef AFS_DJGPP_ENV
FT_GetTimeOfDay(&junk, 0);
+#endif
SignalTimeout(code, &timeout);
}
+#ifdef AFS_DJGPP_ENV
+ IOMGR_CheckNCB();
+#endif /* AFS_DJGPP_ENV */
}
LWP_DispatchProcess();
}
IOMGR_Initialize: so force a check for signals regardless */
memset(allOnes, 0xff, sizeof(allOnes));
+#ifdef AFS_DJGPP_ENV
+ install_ncb_handler();
+#endif /* AFS_DJGPP_ENV */
+
return LWP_CreateProcess(IOMGR, AFS_LWP_MINSTACKSIZE, 0, 0, "IO MANAGER",
&IOMGR_Id);
}
/* This routine calls select is a fashion that simulates the standard sleep routine */
void IOMGR_Sleep (int seconds)
{
+#ifndef AFS_DJGPP_ENV
struct timeval timeout;
timeout.tv_sec = seconds;
timeout.tv_usec = 0;
IOMGR_Select(0, 0, 0, 0, &timeout);
+#else
+ struct timeval timeout;
+ int s;
+ fd_set set, empty;
+ FD_ZERO(&empty);
+ FD_ZERO(&set);
+ s = socket(AF_INET,SOCK_STREAM,0);
+ FD_SET(s,&set);
+
+ timeout.tv_sec = seconds;
+ timeout.tv_usec = 0;
+ IOMGR_Select(1,&set,&empty,&empty,&timeout);
+ close(s);
+#endif /* DJGPP */
}
#endif /* USE_PTHREADS */
+
+#ifdef AFS_DJGPP_ENV
+
+/* Netbios code for djgpp port */
+
+int IOMGR_NCBSelect(ncbp, dos_ncb, timeout)
+ NCB *ncbp;
+ dos_ptr dos_ncb;
+ struct timeval *timeout;
+{
+ struct IoRequest *request;
+ int result;
+
+ if (timeout != NULL && timeout->tv_sec == 0 && timeout->tv_usec == 0)
+ {
+ /* Poll */
+ if (ncbp->ncb_event != NULL)
+ {
+ /* error */
+ return -1;
+ }
+
+ if (get_dos_member_b(NCB, dos_ncb, ncb_cmd_cplt) != 0xff)
+ {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ }
+
+ /* Construct request block & insert */
+ request = NewRequest();
+ request->ncbp = ncbp;
+ request->dos_ncb = dos_ncb;
+
+ if (timeout == NULL)
+ {
+ request->timeout.TotalTime.tv_sec = -1;
+ request->timeout.TotalTime.tv_usec = -1;
+ }
+ else
+ {
+ request -> timeout.TotalTime = *timeout;
+ /* check for bad request */
+ if (timeout->tv_sec < 0 || timeout->tv_usec < 0 || timeout->tv_usec > 999999)
+ {
+ /* invalid arg */
+ iomgr_badtv = *timeout;
+ iomgr_badpid = LWP_ActiveProcess;
+ /* now fixup request */
+ if(request->timeout.TotalTime.tv_sec < 0)
+ request->timeout.TotalTime.tv_sec = 1;
+ request->timeout.TotalTime.tv_usec = 100000;
+ }
+ }
+
+ request->timeout.BackPointer = (char *)request;
+
+ /* Insert my PID in case of IOMGR_Cancel */
+ request -> pid = LWP_ActiveProcess;
+ LWP_ActiveProcess -> iomgrRequest = request;
+
+#ifdef DEBUG
+ request -> timeout.Next = (struct TM_Elem *) 1;
+ request -> timeout.Prev = (struct TM_Elem *) 1;
+#endif /* DEBUG */
+ TM_Insert(Requests, &request->timeout);
+
+ if (ncbp->ncb_event != NULL)
+ {
+ /* since we were given an event, we can return immediately and just
+ signal the event once the request completes. */
+ return 0;
+ }
+ else
+ {
+ /* Wait for action */
+
+ LWP_QWait();
+
+ /* Update parameters & return */
+ result = request -> result;
+
+ FreeRequest(request);
+ return (result > 1 ? 1 : result);
+ }
+}
+
+int IOMGR_CheckNCB()
+{
+ int woke_someone = FALSE;
+ EVENT_HANDLE ev;
+ PROCESS pid;
+
+ anyNCBComplete = FALSE;
+ FOR_ALL_ELTS(r, Requests, {
+ register struct IoRequest *req;
+ req = (struct IoRequest *) r -> BackPointer;
+
+ if (req->dos_ncb && get_dos_member_b(NCB, req->dos_ncb, ncb_cmd_cplt) != 0xff)
+ {
+ /* this NCB has completed */
+ TM_Remove(Requests, &req->timeout);
+
+ /* copy out NCB from DOS to virtual space */
+ dosmemget(req->dos_ncb, sizeof(NCB), (char *) req->ncbp);
+
+ if (ev = req->ncbp->ncb_event)
+ {
+ thrd_SetEvent(ev);
+ }
+ else
+ {
+ woke_someone = TRUE;
+ LWP_QSignal(pid=req->pid);
+ pid->iomgrRequest = 0;
+ }
+ }
+ })
+ return woke_someone;
+}
+
+int ncb_handler(__dpmi_regs *r)
+{
+ anyNCBComplete = TRUE; /* NCB completed */
+ /* Make sure that the IOMGR process doesn't pause on the select. */
+ iomgr_timeout.tv_sec = 0;
+ iomgr_timeout.tv_usec = 0;
+ return;
+}
+
+int install_ncb_handler()
+{
+ callback_info.pm_offset = (long) ncb_handler;
+ if (_go32_dpmi_allocate_real_mode_callback_retf(&callback_info,
+ &callback_regs))
+ {
+ fprintf(stderr, "error, allocate_real_mode_callback_retf failed\n");
+ return -1;
+ }
+
+ handler_seg = callback_info.rm_segment;
+ handler_off = callback_info.rm_offset;
+
+ /*printf("NCB handler_seg=0x%x, off=0x%x\n", handler_seg, handler_off);*/
+}
+#endif /* AFS_DJGPP_ENV */
/* External function declarations. */
#ifdef AFS_NT40_ENV
+#ifndef _MFC_VER /*skip if doing Microsoft foundation class*/
#include <winsock2.h>
+#endif
#elif defined(AFS_LINUX20_ENV)
#include <unistd.h>
#include <time.h>
/* max time we are allowed to spend in a select call on NT */
#define IOMGR_MAXWAITTIME 5 /* seconds */
+/* max time we spend on a select in a Win95 DOS box */
+#define IOMGR_WIN95WAITTIME 5000 /* microseconds */
+
#endif /* __LWP_INCLUDE_ */
#endif /* !KERNEL && !_KMEMUSER */
}\
}
+#ifdef AFS_WIN95_ENV
+
+LPVOID ConvertThreadToFiber(PROCESS x)
+{
+ return NULL;
+}
+LPVOID CreateFiber(DWORD x ,LPVOID y,PROCESS z)
+{
+ return NULL;
+}
+
+VOID SwitchToFiber(LPVOID p)
+{
+}
+
+VOID DeleteFiber(LPVOID p)
+{
+}
+#endif
+
int lwp_MinStackSize = 0;
+
/* LWP_InitializeProcessSupport - setup base support for fibers.
*
* Arguments:
* LWP_SUCCESS (else aborts)
*
*/
+
int LWP_InitializeProcessSupport(int priority, PROCESS *pid)
{
PROCESS pcb;
LWPANCHOR.processcnt--;
}
+
static void Free_PCB(PROCESS pid)
{
Debug(4, ("Entered Free_PCB"))
\*******************************************************************/
#include <afs/param.h>
-#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) || defined(AFS_DJGPP_ENV)
int PRE_Block = 0;
#else
#include <sys/time.h>
*/
#define IGNORE_STDS_H 1
+#ifndef AFS_DJGPP_ENV
#include <afs/param.h>
+#endif /* AFS_DJGPP_ENV */
#if defined(RIOS)
END(returnto)
#endif
-#if defined(AFS_NCR_ENV) || defined(AFS_X86_ENV)
+#if defined(AFS_NCR_ENV) || defined(AFS_X86_ENV) || defined(AFS_DJGPP_ENV)
/* Sun 386i... I hope this does the right thing!!!
*
* Written by Derek Atkins <warlord@MIT.EDU>
struct timeval time;
register int expired;
+#ifndef AFS_DJGPP_ENV
FT_AGetTimeOfDay(&time, 0);
+#else
+ FT_GetTimeOfDay(&time, 0); /* we need a real time value */
+#endif
expired = 0;
FOR_ALL_ELTS(e, tlist, {
if (!blocking(e)) {
struct timeval twait;
struct timeval *tp = NULL;
+#ifndef AFS_DJGPP_ENV
#ifdef AFS_LINUX20_ENV
if (stdin->_IO_read_ptr < stdin->_IO_read_end)
return 1;
return 1;
#endif
#endif
-
+#else /* DJGPP */
+ if (stdin->_cnt > 0)
+ return 1;
+#endif /* DJGPP */
FD_ZERO(&rdfds);
FD_SET(fileno(stdin), &rdfds);
--- /dev/null
+#!/usr/bin/perl
+
+# mkdest: make AFS platform directory for build
+
+if ($#ARGV >= 0) {
+ $srcdir = $ARGV[0];
+}
+else {
+ $srcdir = "/tmp/src";
+}
+$dir = $ENV{PWD};
+
+print "Create build tree from the AFS source tree $srcdir\n";
+print "Create links in platform tree $dir\n";
+
+print "continue (y/n) ? ";
+
+chop ($ans = <STDIN>);
+exit if ($ans ne "y");
+
+mkdir "dest", 0755 || die "Can't create directory dest\n";
+mkdir "obj", 0755 || die "Can't create directory obj\n";
+chdir "obj" || die "Can't change to directory obj\n";
+
+&dodir($srcdir, "..");
+
+sub dodir {
+ local($dir,$destpath) = @_;
+ print "$dir\n";
+ local($a);
+ local($i);
+
+ #if (-e "$dir/RCS") {
+ ## Make RCS link and check out all files in this directory
+ #system("ln -sf $dir/RCS");
+ #system("co RCS/*");
+ #}
+
+ opendir(DIR,$dir) || die "Can't open directory $dir\n";
+ local(@allfiles) = readdir(DIR);
+ closedir(DIR);
+
+ $thisdir = &lastcomp($dir);
+ system("ln -s $destpath/dest DEST");
+ system("ln -s $destpath/../src/$thisdir SRC");
+
+ foreach $a (@allfiles) {
+ #print "$a\n";
+ if (! -d "$dir/$a") {
+ system("ln -s SRC/$a");
+ next;
+ }
+ next if $a eq '.';
+ next if $a eq '..';
+ next if $a eq 'RCS';
+
+ # Make this subdirectory on local copy
+ mkdir $a, 0755 || die "Can't create directory $dir/$a\n";
+ chdir $a || die "Can't change to directory $dir/$a\n";
+
+ # Recursively process this directory
+ &dodir("$dir/$a", "$destpath/..");
+ chdir '..';
+ }
+}
+
+sub lastcomp {
+ local($dir) = @_;
+
+ $_ = $dir;
+ if (/$srcdir\/(\S+)/) {
+ $dir = $1;
+ }
+ else {
+ $dir = $_;
+ }
+ return $dir;
+}
rem License. For details, see the LICENSE file in the top-level source
rem directory or online at http://www.openafs.org/dl/license10.html
+
REM AFS build environment variables for Windows NT.
REM Modify for local configuration; common defaults shown.
REM ########################################################################
-
REM ########################################################################
REM
REM NOTE: You should run NTLANG.REG before attempting to build localized
:args_done
REM ########################################################################
REM General required definitions:
-REM SYS_NAME = <AFS system name>
-
-set SYS_NAME=i386_nt40
+REM SYS_NAME = AFS system name
+SET SYS_NAME=i386_win95
+SET _WIN32_IE=0x400
REM ########################################################################
REM NTMakefile required definitions:
-REM AFSDEV_BUILDTYPE = [ CHECKED | FREE ]
-REM AFSDEV_INCLUDE = <default include directories>
-REM AFSDEV_LIB = <default library directories>
-REM AFSDEV_BIN = <default build binary directories>
+REM AFSDEV_BUILDTYPE = CHECKED / FREE
+REM AFSDEV_INCLUDE = default include directories
+REM AFSDEV_LIB = default library directories
+REM AFSDEV_BIN = default build binary directories
set AFSDEV_BUILDTYPE=%AFSBLD_TYPE%
-set MSVCDIR=c:\dev\tools\DevStudio\vc
+rem Location of VC++ development folder
+set MSVCDIR=c:\progra~1\micros~2\vc98
set AFSDEV_INCLUDE=%MSVCDIR%\include;%MSVCDIR%\mfc\include
set AFSDEV_LIB=%MSVCDIR%\lib;%MSVCDIR%\mfc\lib
set AFSDEV_BIN=%MSVCDIR%\bin
-set AFSROOT=d:\afs\openafs
+REM ########################################################################
+REM Location of base folder where source lies, build directory
+REM e.g. AFSROOT\SRC is source directory of the build tree
+
+set AFSROOT=D:\Dev\AfsSorce\OpenAF~2.2
REM ########################################################################
REM NTMakefile optional definitions:
REM
REM See NTMakefile.SYS_NAME; will normally use defaults.
REM
-REM IS5ROOT = <root directory of the InstallShield5 installation>
-REM You should only define this if you have InstallShield installed on
-REM your computer and want to create the setup as part of the build.
-set IS5ROOT=d:\progra~1\instal~1\instal~1.1pr
+IF [%HOMEDRIVE%]==[] SET HOMEDRIVE=C:
REM ########################################################################
REM Options necessary when using bison
sgi_* ) \
$(CC) -g -I${DESTDIR}include ${CFLAGS} install.c -o pinstall ${LIBS} -lmld ;; \
*) \
- $(CC) -g -I${DESTDIR}include ${CFLAGS} install.c -o pinstall ${LIBS} ;; \
+ $(CC) -g -I. -I${DESTDIR}include ${CFLAGS} install.c -o pinstall ${LIBS} ;; \
esac
- [ -d test ] && ( cd test; $(MAKE) )
- [ -d test ] && ./test/test_install
install: ${DESTDIR}lib/afs/libprocmgmt.a
${INSTALL} procmgmt.h ${DESTDIR}include/afs
+includes:
+ ${INSTALL} procmgmt.h ${DESTDIR}include/afs
+
clean:
$(RM) -f *.o libprocmgmt.a \
core AFS_component_version_number.c
KILL_EXELIBS =\
$(DESTDIR)\lib\afs\afsprocmgmt.lib
-$(RS_KILL_EXEFILE): $(KILL_EXEOBJS) $(KILL_EXELIBS)
+$(RS_KILL_EXEFILE): $(KILL_EXEOBJS) $(KILL_EXELIBS)
$(EXECONLINK)
$(EXEPREP)
install_headers: $(INCFILES)
+install9x: install_headers
+
install: install_headers $(DLLFILE) $(CL_KILL_EXEFILE)
clean::
+ $(DEL) $(INCFILES)
\ No newline at end of file
${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
${INSTALL} -f db_verify ${DESTDIR}etc/prdb_check
echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_pt' >> ${DESTDIR}include/afs/prerror.h
+
+libinstall: ${DESTDIR}lib/afs/libprot.a
+ ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
+ ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
+ ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
+ ${INSTALL} ptint.h ${DESTDIR}include/afs/print.h
+ ${INSTALL} pterror.h ${DESTDIR}include/afs/prerror.h
+ ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
+
# Override default definitions in NTMakefile.$(SYS_NAME) before including.
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!include ..\config\NTMakefile.version
############################################################################
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afs\afsaudit.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
- $(DESTDIR)\lib\afs\afsreg.lib \
- $(DESTDIR)\lib\afs\afsprocmgmt.lib
+ $(DESTDIR)\lib\afs\afsreg.lib
+
+!IF (("$(SYS_NAME)"!="i386_win95" ) && ("$(SYS_NAME)"!="I386_WIN95" ))
+PTSERVER_EXELIBS =$(PTSERVER_EXELIBS) $(DESTDIR)\lib\afs\afsprocmgmt.lib
+!ENDIF
$(PTSERVER): $(PTSERVER_EXEOBJS) $(PTSERVER_EXELIBS)
$(INCFILEDIR)\afs\prserver.h $(INCFILEDIR)\afs\print.h \
$(INCFILEDIR)\afs\prerror.h $(INCFILEDIR)\afs\prclient.h
+install9X: $(INCFILES) $(LIBFILE) $(PTS) \
+ $(DESTDIR)\root.server\usr\afs\bin\pts.exe \
+ $(INCFILEDIR)\afs\prserver.h $(INCFILEDIR)\afs\print.h \
+ $(INCFILEDIR)\afs\prerror.h $(INCFILEDIR)\afs\prclient.h
+
+install_libutils: $(INCFILES) $(LIBFILE) $(PTS)
# install various exe's and header files
$(DESTDIR)\root.server\usr\afs\bin\pts.exe: $(PTS)
$(DEL) ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h
$(DEL) readgroup.exe readpwd.exe db_verify.exe testpt.exe
$(DEL) pterror.h pterror.c
+ $(DEL) $(PTS)
############################################################################
# tests?
--- /dev/null
+@echo off
+if [%1]==[-f] shift
+if [%1]==[/f] shift
+if [%1]==[-F] shift
+if [%1]==[/F] shift
+if [%1]==[/q] shift
+if [%1]==[/Q] shift
+if [%1]==[-q] shift
+if [%1]==[-Q] shift
+if [%1]==[-f] shift
+if [%1]==[/f] shift
+if [%1]==[-F] shift
+if [%1]==[/F] shift
+if not [%1]==[] del %1 <%AFSROOT%\src\rmbat.rsp
+if not [%1]==[] shift
+if not [%1]==[] %AFSROOT%\src\rmbat %1 %2 %3 %4 %5 %6 %7 %8
RXOBJS = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o rx_trace.o rx_conncache.o \
- xdr_int64.o
+ xdr_int64.o
MULTIOBJS = rx_multi.o
LIBOBJS = ${RXOBJS} ${MULTIOBJS} ${XDROBJS}
+LIBOBJS_djgpp = ${RXOBJS_djgpp} ${MULTIOBJS} ${XDROBJS_djgpp}
+
+XMIT = rx_xmit_nt.o
+XMIT_H = rx_xmit_nt.h
+
+XDROBJS_djgpp = xdr.o xdr_rec.o xdr_stdio.o \
+ xdr_float.o xdr_refernce.o xdr_update.o \
+ xdr_array.o xdr_mem.o
+
+RXOBJS_djgpp = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
+ rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o rx_trace.o rx_conncache.o \
+ $(XMIT)
+
BASICINCLS = ${SRCDIR}include/lwp.h ${SRCDIR}include/lock.h \
rx_clock.h rx_queue.h rx_event.h
librx.a: ${LIBOBJS} RX_component_version_number.o
-rm -f $@
- ar rv $@ RX_component_version_number.o ${LIBOBJS}
+ $(AR) rv $@ RX_component_version_number.o ${LIBOBJS}
$(RANLIB) $@
+librx-djgpp: ${LIBOBJS_djgpp} RX_component_version_number.o
+ -rm -f librx.a
+ $(AR) rv librx.a RX_component_version_number.o ${LIBOBJS_djgpp}
+ $(RANLIB) librx.a
+
${DESTDIR}etc/rxdebug: rxdebug
${INSTALL} rxdebug ${DESTDIR}etc/rxdebug
install.noversion noversion install all system: librx.a includes kinstall ukinstall
${INSTALL} librx.a ${DESTDIR}lib
-includes: rx.h rx_user.h rx_event.h rx_queue.h rx_clock.h xdr.h rx_null.h rx_globals.h
+install-djgpp: librx-djgpp includes includes-djgpp kinstall ukinstall
+ ${INSTALL} librx.a ${DESTDIR}lib
+
+includes-djgpp: $(XMIT_H)
+ set ${DESTDIR}include/rx; $(MKDIR_IF_NEEDED)
+ ${INSTALL} $(XMIT_H) ${DESTDIR}include/rx
+
+includes: rx.h rx_user.h rx_event.h rx_queue.h rx_clock.h xdr.h rx_null.h rx_globals.h
set ${DESTDIR}include/rx; $(MKDIR_IF_NEEDED)
${INSTALL} rx_packet.h rx.h rx_user.h rx_event.h rx_queue.h \
rx_globals.h \
# RX has different strings for it's version number.
VERSFILE=RX_component_version_number
CML_PREFIX=rx_
+
!include ..\config\NTMakefile.version
# Additional debugging flag for RX.
$(EXECONLINK)
$(EXEPREP)
-
install: $(LIBFILE) $(INCFILES) $(RXDEBUG)
+
+install9x: $(LIBFILE) $(INCFILES)
char *htable, *ptable;
int tmp_status;
+#if defined(AFS_DJGPP_ENV) && !defined(DEBUG)
+ __djgpp_set_quiet_socket(1);
+#endif
+
SPLVAR;
INIT_PTHREAD_LOCKS
* directory or online at http://www.openafs.org/dl/license10.html
*/
+
#ifndef lint
#endif
/* getaddr -- get our internet address. July, 1986 */
#include <afs/param.h>
+#ifndef AFS_DJGPP_ENV
#ifndef KERNEL
#ifndef AFS_NT40_ENV
#include <sys/types.h>
#endif /* ! AFS_NT40_ENV */
#endif /* !KERNEL || UKERNEL */
+
+#endif /* !AFS_DJGPP_ENV */
* Put the socket into non-blocking mode so that rx_Listener
* can do a polling read before entering select
*/
+#ifndef AFS_DJGPP_ENV
if (fcntl(sock, F_SETFL, FNDELAY) == -1) {
perror("fcntl");
(osi_Msg "rxi_Listen: unable to set non-blocking mode on socket\n");
return -1;
}
+#else
+ if ( __djgpp_set_socket_blocking_mode(sock, 1) < 0 ) {
+ perror("__djgpp_set_socket_blocking_mode");
+ (osi_Msg "rxi_Listen: unable to set non-blocking mode on socket\n");
+ return -1;
+ }
+#endif /* AFS_DJGPP_ENV */
if (sock > FD_SETSIZE-1) {
(osi_Msg "rxi_Listen: socket descriptor > (FD_SETSIZE-1) = %d\n",
if (code == ENOSPC)
err = VDISKFULL;
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
/* EDQUOT doesn't exist on solaris */
else if (code == EDQUOT)
err = VOVERQUOTA;
if (code == VDISKFULL)
err = ENOSPC;
else if (code == VOVERQUOTA)
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
err = ENOSPC;
#else
err = EDQUOT;
#include "sys/types.h"
#include <sys/stat.h>
#include <errno.h>
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
#ifdef AFS_NT40_ENV
#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif /* AFS_NT40_ENV */
#include "rx_xmit_nt.h"
#include <stdlib.h>
#else
#ifndef _RX_PACKET_
#define _RX_PACKET_
#ifndef UKERNEL
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
#include "rx_xmit_nt.h"
-#else
-#include <sys/uio.h>
#endif
+#ifndef AFS_NT40_ENV
+#include <sys/uio.h>
+#endif /* !AFS_NT40_ENV */
#endif /* !UKERNEL */
/* this file includes the macros and decls which depend on packet
* format, and related packet manipulation macros. Note that code
*/
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
# include <sys/ioctl.h>
#endif
# include <fcntl.h>
-#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
# include <sys/syscall.h>
#endif
#include <afs/afs_args.h>
extern int rxi_Listen(osi_socket sock);
int greedy;
-#ifndef AFS_NT40_ENV
+#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
if (ntohs(port) >= IPPORT_RESERVED && ntohs(port) < IPPORT_USERRESERVED) {
/* (osi_Msg "%s*WARNING* port number %d is not a reserved port number. Use port numbers above %d\n", name, port, IPPORT_USERRESERVED);
*/ ;
goto error;
}
-#ifndef AFS_NT40_ENV
+#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
/*
* Set close-on-exec on rx socket
*/
len1 = 32766;
len2 = rx_UdpBufSize;
+#ifndef AFS_DJGPP_ENV
greedy =
(setsockopt(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
sizeof(len2)) >= 0);
sizeof(len1)) >= 0) &&
(setsockopt(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
sizeof(len2)) >= 0);
+#endif /* AFS_DJGPP_ENV */
}
+#ifndef AFS_DJGPP_ENV
if (!greedy)
(osi_Msg "%s*WARNING* Unable to increase buffering on socket\n", name);
+#endif /* AFS_DJGPP_ENV */
if (rxi_Listen(socketFd) < 0) {
goto error;
}
u_int rxi_numNetAddrs;
static int Inited = 0;
-#if defined(AFS_NT40_ENV)
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
int rxi_getaddr(void)
{
if (rxi_numNetAddrs > 0)
-#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DJGPP_ENV)
int rxi_syscall(a3, a4, a5)
afs_uint32 a3, a4;
void * a5;
{
int s;
int i, j, len, res;
+#ifndef AFS_DJGPP_ENV
struct ifconf ifc;
struct ifreq ifs[ADDRSPERSITE];
struct ifreq ifreq, *ifr;
char buf[BUFSIZ], *cp, *cplim;
#endif
struct sockaddr_in *a;
+#endif /* AFS_DJGPP_ENV */
LOCK_IF_INIT
if (Inited) {
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) return;
+#ifndef AFS_DJGPP_ENV
#ifdef AFS_AIX41_ENV
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
rxi_MorePackets(npackets*(ncbufs+1));
}
}
+#else /* AFS_DJGPP_ENV */
+ close(s);
+ return;
+#endif /* AFS_DJGPP_ENV */
}
#endif /* AFS_NT40_ENV */
*/
#include <afs/param.h>
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
+#ifdef AFS_NT40_ENV
#include <winsock2.h>
+#else
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+typedef int SOCKET;
+#endif
#include "rx.h"
#include "rx_packet.h"
#include "rx_globals.h"
#include "rx_xmit_nt.h"
+#ifdef AFS_NT40_ENV
#include <malloc.h>
+#endif
#include <errno.h>
int recvmsg(int socket, struct msghdr *msgP, int flags)
code = sendto((SOCKET)socket, sbuf, size, flags,
(struct sockaddr*)(msgP->msg_name), msgP->msg_namelen);
+#ifdef AFS_NT40_ENV
if (code == SOCKET_ERROR) {
code = WSAGetLastError();
switch (code) {
}
code = -1;
}
+#endif /* AFS_NT40_ENV */
if (code < size) {
errno = EIO;
-#endif
+#endif /* AFS_NT40_ENV || AFS_DJGPP_ENV */
#define _RX_XMIT_NT_H_
-typedef struct iovec {
+typedef struct iovec
+#ifndef AFS_DJGPP_ENV
+{
void *iov_base;
int iov_len;
-} iovec_t;
+}
+#endif
+iovec_t;
struct msghdr {
char * msg_name;
#define __XDR_INCLUDE__
#include <afs/param.h>
#ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
#include <winsock2.h>
+#endif /* _MFC_VER */
#endif
#define bool_t int
#define enum_t int
rpc_svcout.o rpc_clntout.o
GOAL=rxgen
-CFLAGS = ${DBUG} -I${DESTDIR}include ${XCFLAGS}
+CFLAGS = ${DBUG} -I. -I${DESTDIR}include ${XCFLAGS}
USNS=cellname
SD=../../../src/CML
install: AFS_component_version_number.c $(EXEFILE) $(INCFILES)
+install9x: install
clean::
-
+ $(DEL) $(EXEFILE)
install: $(DOMESTIC) $(INCFILES) $(LIBFILE)
+install9x: install
clean::
$(DEL) $(RXKAD_INCFILE) rxkad_errs.c
librxstat.a: ${LIBOBJS} AFS_component_version_number.o
-rm -f $@
- ar rv $@ AFS_component_version_number.o ${LIBOBJS}
+ $(AR) rv $@ AFS_component_version_number.o ${LIBOBJS}
$(RANLIB) $@
kinstall: ${KSRCS}
# directory or online at http://www.openafs.org/dl/license10.html
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
+!IF (EXIST(..\config\NTMakefile.version))
!INCLUDE ..\config\NTMakefile.version
+!ENDIF
INCFILEDIR = $(DESTDIR)\include
$(RXGEN) -x $**
install: $(LIBFILE) $(INCFILES)
+
+install9x: install
--- /dev/null
+@echo %1 %2 %3 %4 %5
\ No newline at end of file
# Install target; primary makefile target
install: $(INCFILES) $(LIBFILE)
+install9x: install
############################################################################
# Local clean target; augments predefined clean target
clean::
+ $(DEL) $(LIBFILE)
\ No newline at end of file
HKEY parmKey;
DWORD dummyLen;
long code;
+ int hostsize;
if (fileNamep) {
drivep = strchr(fileNamep, ':');
goto havehost;
nogateway:
/* No gateway name in registry; use ourself */
+#ifndef AFS_WIN95_ENV
gethostname(hostName, sizeof(hostName));
+#else
+ /* DJGPP version of gethostname gets the NetBIOS
+ name of the machine, so that is what we are using for
+ the AFS server name instead of the DNS name. */
+ hostsize = sizeof(hostName);
+ GetComputerName(hostName, &hostsize);
+#endif /* AFS_WIN95_ENV */
+
havehost:
ctemp = strchr(hostName, '.'); /* turn ntafs.* into ntafs */
if (ctemp) *ctemp = 0;
hostName, SMB_IOCTL_FILENAME);
}
+ fflush(stdout);
/* now open the file */
fh = CreateFile(tbuffer, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH, NULL);
+ fflush(stdout);
if (fh == INVALID_HANDLE_VALUE)
return -1;
static long UnmarshallLong(fs_ioctlRequest_t *reqp, long *valp)
{
/* not enough data left */
- if (reqp->nbytes < 4) return -1;
+ if (reqp->nbytes < 4) { return -1; }
memcpy(valp, reqp->mp, 4);
reqp->mp += 4;
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
- $(DESTDIR)\lib\pthread.lib \
+!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+ $(DESTDIR)\lib\win95\pthread.lib \
+!ELSE
+ $(DESTDIR)\lib\pthread.lib \
+!ENDIF
$(DESTDIR)\lib\afsdes.lib
# $(DESTDIR)\lib\afsauthent.lib \
############################################################################
# Install target; primary makefile target
+install9X: $(INCFILES) $(LIBFILE)
+
install: $(INCFILES) $(LIBFILE) $(CL_UDBG_EXEFILE)
# directory or online at http://www.openafs.org/dl/license10.html
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!IF (EXIST(..\config\NTMakefile.version))
+!include ..\config\NTMakefile.version
+!ENDIF
############################################################################
install: $(INCFILES) $(LIBFILE)
+install9x: install
clean::
-
+ $(DEL) $(LIBFILE)
test:
$(CD) test
COMPONENT=util
include ../config/Makefile.${SYS_NAME}
-CFLAGS = ${OPTMZ} -I$(SRCDIR)include ${XCFLAGS}
+CFLAGS = ${OPTMZ} -I. -I$(SRCDIR)include ${XCFLAGS}
LDFLAGS = ${OPTMZ} ${XLDFLAGS}
objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
install: install0 kinstall ukinstall
+install_headers:
+ ${INSTALL} assert.h errors.h vice.h remote.h ktime.h fileutil.h \
+ netutils.h packages.h afsutil.h pthread_glock.h \
+ afs_atomlist.h afs_lhash.h \
+ ${DESTDIR}include/afs
+
kinstall:
${INSTALL} vice.h ../libafs/afs
${INSTALL} base64.c ../libafs/afs/afs_base64.c
install: $(INCFILES) $(LIBFILE)
+
+install9x: install
+
+clean::
+ $(DEL) $(LIBFILE)
\ No newline at end of file
#ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
#include <winsock2.h>
+#endif /* _MFC_VER */
/* Initialize the windows sockets before calling networking routines. */
extern int afs_winsockInit(void);
${INSTALL} cnvldb.h ${DESTDIR}include/afs
${INSTALL} vldb_check ${DESTDIR}/etc
+libinstall: libvldb.a
+ ${INSTALL} libvldb.a ${DESTDIR}lib/afs
+ ${INSTALL} vl_opcodes.h vlserver.h vldbint.h ${DESTDIR}include/afs
+ ${INSTALL} cnvldb.h ${DESTDIR}include/afs
# Override default definitions in NTMakefile.$(SYS_NAME) before including.
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!include ..\config\NTMakefile.version
############################################################################
install: $(INCFILES) $(LIBFILE) $(VLSERVER) vldb_check.exe vlclient.exe \
$(MT_LIBFILE)
+install9x: install
+
+install_libutils: $(INCFILES) $(LIBFILE)
+
############################################################################
# clean up
}
bcopy(th->h_addr,&myHost,sizeof(afs_int32));
-#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
signal(SIGXCPU, CheckSignal_Signal);
#endif
/* get list of servers */