If I call DuplicateHandle in Win32,the HandleCount for the FileObject will
increase,right?And the PointerCount for the FileObject will increase
too,right?
If I call CreateFileMapping in Win32,the HandleCount for the FileObject will
increase,right?And the PointerCount for the FileObject will increase
too,right?
If I call MapViewOfFile,the HandleCount for the FileObject will
increase,right?And the PointerCount for the FileObject will increase
too,right?
> If I call DuplicateHandle in Win32,the HandleCount for the FileObject will
increase,right?
Yes.
And the PointerCount for the FileObject will increase
too,right?
No.
If I call CreateFileMapping in Win32,the HandleCount for the FileObject will
increase,right?And the PointerCount for the FileObject will increase
too,right?
Only the PointerCount, since the control area holds a PFILE_OBJECT. Note: if
the file is cached, then the control area is already created inside
CcInitializeCacheMap, and mapping a file will only addref the control area, and
not the FILE_OBJECT.
If I call MapViewOfFile,the HandleCount for the FileObject will
increase,right?And the PointerCount for the FileObject will increase
too,right?
No. The VAD will be created, which will hold 1 additional ref to the control
area. The file object itself will not be addrefed.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com