怎么能获取对这个文件的独立访问的权限?
谢谢了
9 个解决方案
#1
hook createfile和closehandle这两个api进行监控
#2
不能用hook
没有直接一点的获得文件属性的函数或者API么??
#3
linux下有lsof |grep fileName
#4
windows 平台 忘说了……
#6
获取对文件独立访问权限很简单:
Open a file for sharing.
int _sopen( const char *filename, int oflag, int shflag [, int pmode ] );
……
The argument shflag is a constant expression consisting of one of the following manifest constants, defined in SHARE.H.
_SH_DENYRW
Denies read and write access to file
_SH_DENYWR
Denies write access to file
_SH_DENYRD
Denies read access to file
_SH_DENYNO
Permits read and write access
Open a file for sharing.
int _sopen( const char *filename, int oflag, int shflag [, int pmode ] );
……
The argument shflag is a constant expression consisting of one of the following manifest constants, defined in SHARE.H.
_SH_DENYRW
Denies read and write access to file
_SH_DENYWR
Denies write access to file
_SH_DENYRD
Denies read access to file
_SH_DENYNO
Permits read and write access
#7
还是得用驱动。
#8
但是实际上没必要去检查吧,你只需去访问文件试一试就知道了
stat -c "%a %n" *
#9
谢谢大家
最后用CreateFile实现的,
第三个参数给NULL, 然后OPEN_EXISTING, 如果能获得句柄就是已经复制完了
回头研究下zhao4zhong1的方法
最后用CreateFile实现的,
第三个参数给NULL, 然后OPEN_EXISTING, 如果能获得句柄就是已经复制完了
回头研究下zhao4zhong1的方法
#1
hook createfile和closehandle这两个api进行监控
#2
不能用hook
没有直接一点的获得文件属性的函数或者API么??
#3
linux下有lsof |grep fileName
#4
windows 平台 忘说了……
#5
#6
获取对文件独立访问权限很简单:
Open a file for sharing.
int _sopen( const char *filename, int oflag, int shflag [, int pmode ] );
……
The argument shflag is a constant expression consisting of one of the following manifest constants, defined in SHARE.H.
_SH_DENYRW
Denies read and write access to file
_SH_DENYWR
Denies write access to file
_SH_DENYRD
Denies read access to file
_SH_DENYNO
Permits read and write access
Open a file for sharing.
int _sopen( const char *filename, int oflag, int shflag [, int pmode ] );
……
The argument shflag is a constant expression consisting of one of the following manifest constants, defined in SHARE.H.
_SH_DENYRW
Denies read and write access to file
_SH_DENYWR
Denies write access to file
_SH_DENYRD
Denies read access to file
_SH_DENYNO
Permits read and write access
#7
还是得用驱动。
#8
但是实际上没必要去检查吧,你只需去访问文件试一试就知道了
stat -c "%a %n" *
#9
谢谢大家
最后用CreateFile实现的,
第三个参数给NULL, 然后OPEN_EXISTING, 如果能获得句柄就是已经复制完了
回头研究下zhao4zhong1的方法
最后用CreateFile实现的,
第三个参数给NULL, 然后OPEN_EXISTING, 如果能获得句柄就是已经复制完了
回头研究下zhao4zhong1的方法