N
nbelyh
I need to protect Visio files from being accessed from outside of
Visio while they are edited in Visio.
(In our solution, normally, visio files are stored in database, but
for editing, they are pulled out)
The options I can imagine:
1. Create a temporary file, work with it, delte after working.
The problem with this approach is, how do I make visio block file for
exclusive access?
That is, I'd want to deny reading for all other processes while the
file is open in Visio.
Unfortunately, OpenEx does not have a flag "exclusive access"...
And fighting this seem to sound as bad as API hooking (CreateFile
function),
or discovering file handle with ZwQueryInformation to change file
share mode to exclusive.
Or there is a plain solution I missed?
2. Creating a named pipe and passing Visio a path to it (Will it work?
Can visio read named pipes?)
I.e. does Visio use "seek" to read files, or it just reads it
sequentially?
3. Creating special folder for temporary files, accessible for only
one user (created on setup), and impersonating current thread as this
user when doing file operations (before calling OpenEx, SaveAs,
etc)... Can it work?
Any advises or comments are greately appreciated....
Visio while they are edited in Visio.
(In our solution, normally, visio files are stored in database, but
for editing, they are pulled out)
The options I can imagine:
1. Create a temporary file, work with it, delte after working.
The problem with this approach is, how do I make visio block file for
exclusive access?
That is, I'd want to deny reading for all other processes while the
file is open in Visio.
Unfortunately, OpenEx does not have a flag "exclusive access"...
And fighting this seem to sound as bad as API hooking (CreateFile
function),
or discovering file handle with ZwQueryInformation to change file
share mode to exclusive.
Or there is a plain solution I missed?
2. Creating a named pipe and passing Visio a path to it (Will it work?
Can visio read named pipes?)
I.e. does Visio use "seek" to read files, or it just reads it
sequentially?
3. Creating special folder for temporary files, accessible for only
one user (created on setup), and impersonating current thread as this
user when doing file operations (before calling OpenEx, SaveAs,
etc)... Can it work?
Any advises or comments are greately appreciated....