mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
dll: fuse: move fsp_fuse_obj_* to sdll/fuse/shared.h
This commit is contained in:
parent
e4077c92e9
commit
ad1b53e5a4
@ -122,35 +122,6 @@ static struct fuse_opt fsp_fuse_core_opts[] =
|
||||
static INIT_ONCE fsp_fuse_initonce = INIT_ONCE_STATIC_INIT;
|
||||
static DWORD fsp_fuse_tlskey = TLS_OUT_OF_INDEXES;
|
||||
|
||||
struct fsp_fuse_obj_hdr
|
||||
{
|
||||
void (*dtor)(void *);
|
||||
__declspec(align(MEMORY_ALLOCATION_ALIGNMENT)) UINT8 ObjectBuf[];
|
||||
};
|
||||
|
||||
static inline void *fsp_fuse_obj_alloc(struct fsp_fuse_env *env, size_t size)
|
||||
{
|
||||
struct fsp_fuse_obj_hdr *hdr;
|
||||
|
||||
hdr = env->memalloc(sizeof(struct fsp_fuse_obj_hdr) + size);
|
||||
if (0 == hdr)
|
||||
return 0;
|
||||
|
||||
hdr->dtor = env->memfree;
|
||||
memset(hdr->ObjectBuf, 0, size);
|
||||
return hdr->ObjectBuf;
|
||||
}
|
||||
|
||||
static inline void fsp_fuse_obj_free(void *obj)
|
||||
{
|
||||
if (0 == obj)
|
||||
return;
|
||||
|
||||
struct fsp_fuse_obj_hdr *hdr = (PVOID)((PUINT8)obj - sizeof(struct fsp_fuse_obj_hdr));
|
||||
|
||||
hdr->dtor(hdr);
|
||||
}
|
||||
|
||||
static BOOL WINAPI fsp_fuse_initialize(
|
||||
PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context)
|
||||
{
|
||||
|
@ -19,9 +19,9 @@
|
||||
#define WINFSP_DLL_FUSE_LIBRARY_H_INCLUDED
|
||||
|
||||
#include <dll/library.h>
|
||||
#include <dll/fuse/shared.h>
|
||||
#include <fuse/fuse.h>
|
||||
#include <fuse/fuse_opt.h>
|
||||
#include <dll/fuse/shared.h>
|
||||
|
||||
#define FSP_FUSE_LIBRARY_NAME LIBRARY_NAME "-FUSE"
|
||||
|
||||
|
@ -20,4 +20,33 @@
|
||||
|
||||
#define enosys(env) ('C' == (env)->environment ? 88 : 40)
|
||||
|
||||
struct fsp_fuse_obj_hdr
|
||||
{
|
||||
void (*dtor)(void *);
|
||||
__declspec(align(MEMORY_ALLOCATION_ALIGNMENT)) UINT8 ObjectBuf[];
|
||||
};
|
||||
|
||||
static inline void *fsp_fuse_obj_alloc(struct fsp_fuse_env *env, size_t size)
|
||||
{
|
||||
struct fsp_fuse_obj_hdr *hdr;
|
||||
|
||||
hdr = env->memalloc(sizeof(struct fsp_fuse_obj_hdr) + size);
|
||||
if (0 == hdr)
|
||||
return 0;
|
||||
|
||||
hdr->dtor = env->memfree;
|
||||
memset(hdr->ObjectBuf, 0, size);
|
||||
return hdr->ObjectBuf;
|
||||
}
|
||||
|
||||
static inline void fsp_fuse_obj_free(void *obj)
|
||||
{
|
||||
if (0 == obj)
|
||||
return;
|
||||
|
||||
struct fsp_fuse_obj_hdr *hdr = (PVOID)((PUINT8)obj - sizeof(struct fsp_fuse_obj_hdr));
|
||||
|
||||
hdr->dtor(hdr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -19,7 +19,6 @@
|
||||
#define WINFSP_DLL_FUSE3_LIBRARY_H_INCLUDED
|
||||
|
||||
#include <dll/library.h>
|
||||
#include <dll/fuse/shared.h>
|
||||
#include <fuse/fuse.h>
|
||||
#undef FUSE_H_
|
||||
#undef FUSE_COMMON_H_
|
||||
@ -27,6 +26,7 @@
|
||||
#undef FUSE_MINOR_VERSION
|
||||
#undef fuse_main
|
||||
#include <fuse3/fuse.h>
|
||||
#include <dll/fuse/shared.h>
|
||||
|
||||
struct fuse3
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user