mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
dll: fuse: winpid_to_pid
This commit is contained in:
parent
193d5f4e91
commit
9deb9d5319
@ -178,6 +178,7 @@ struct fuse_flock
|
|||||||
fsp_fuse_daemonize, \
|
fsp_fuse_daemonize, \
|
||||||
fsp_fuse_set_signal_handlers, \
|
fsp_fuse_set_signal_handlers, \
|
||||||
0/*conv_to_win_path*/, \
|
0/*conv_to_win_path*/, \
|
||||||
|
0/*winpid_to_pid*/, \
|
||||||
{ 0 }, \
|
{ 0 }, \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -188,6 +189,7 @@ struct fuse_flock
|
|||||||
fsp_fuse_daemonize, \
|
fsp_fuse_daemonize, \
|
||||||
fsp_fuse_set_signal_handlers, \
|
fsp_fuse_set_signal_handlers, \
|
||||||
0/*conv_to_win_path*/, \
|
0/*conv_to_win_path*/, \
|
||||||
|
0/*winpid_to_pid*/, \
|
||||||
{ 0 }, \
|
{ 0 }, \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -231,6 +233,7 @@ struct fuse_flock
|
|||||||
fsp_fuse_daemonize, \
|
fsp_fuse_daemonize, \
|
||||||
fsp_fuse_set_signal_handlers, \
|
fsp_fuse_set_signal_handlers, \
|
||||||
fsp_fuse_conv_to_win_path, \
|
fsp_fuse_conv_to_win_path, \
|
||||||
|
fsp_fuse_winpid_to_pid, \
|
||||||
{ 0 }, \
|
{ 0 }, \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +254,8 @@ struct fsp_fuse_env
|
|||||||
int (*daemonize)(int);
|
int (*daemonize)(int);
|
||||||
int (*set_signal_handlers)(void *);
|
int (*set_signal_handlers)(void *);
|
||||||
char *(*conv_to_win_path)(const char *);
|
char *(*conv_to_win_path)(const char *);
|
||||||
void (*reserved[3])();
|
fuse_pid_t (*winpid_to_pid)(uint32_t);
|
||||||
|
void (*reserved[2])();
|
||||||
};
|
};
|
||||||
|
|
||||||
FSP_FUSE_API void FSP_FUSE_API_NAME(fsp_fuse_signal_handler)(int sig);
|
FSP_FUSE_API void FSP_FUSE_API_NAME(fsp_fuse_signal_handler)(int sig);
|
||||||
@ -362,6 +366,13 @@ static inline char *fsp_fuse_conv_to_win_path(const char *path)
|
|||||||
0/*CCP_POSIX_TO_WIN_A*/ | 0x100/*CCP_RELATIVE*/,
|
0/*CCP_POSIX_TO_WIN_A*/ | 0x100/*CCP_RELATIVE*/,
|
||||||
path);
|
path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline fuse_pid_t fsp_fuse_winpid_to_pid(uint32_t winpid)
|
||||||
|
{
|
||||||
|
pid_t cygwin_winpid_to_pid(int winpid);
|
||||||
|
pid_t pid = cygwin_winpid_to_pid(winpid);
|
||||||
|
return -1 != pid ? pid : (fuse_pid_t)winpid;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ NTSTATUS fsp_fuse_op_enter(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
context->private_data = f->data;
|
context->private_data = f->data;
|
||||||
context->uid = Uid;
|
context->uid = Uid;
|
||||||
context->gid = Gid;
|
context->gid = Gid;
|
||||||
context->pid = Pid;
|
context->pid = 0 != f->env->winpid_to_pid ? f->env->winpid_to_pid(Pid) : Pid;
|
||||||
|
|
||||||
contexthdr = FSP_FUSE_HDR_FROM_CONTEXT(context);
|
contexthdr = FSP_FUSE_HDR_FROM_CONTEXT(context);
|
||||||
contexthdr->PosixPath = PosixPath;
|
contexthdr->PosixPath = PosixPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user