76 static int curr_num = 0;
79 if (
fs->root_cluster) {
85 clu_num =
fs->root_cluster;
87 while (clu_num > 0 && clu_num != -1) {
95 if ((
i %
fs->cluster_size) == 0) {
106 die(
"Root directory has no cluster allocated!");
107 for (clu_num = prev + 1; clu_num != prev; clu_num++) {
110 if (clu_num >=
fs->data_clusters + 2)
117 die(
"Root directory full and no free cluster");
122 memset(&d2, 0,
sizeof(d2));
124 for (
i = 0;
i <
fs->cluster_size;
i +=
sizeof(DIR_ENT))
127 memset(de, 0,
sizeof(DIR_ENT));
133 clu_num =
fs->root_cluster;
136 while (clu_num > 0 && clu_num != -1) {
137 fs_read(offset2,
sizeof(DIR_ENT), &d2);
139 !
strncmp((
const char *)d2.name, (
const char *)de->name,
142 i +=
sizeof(DIR_ENT);
143 offset2 +=
sizeof(DIR_ENT);
144 if ((
i %
fs->cluster_size) == 0) {
151 if (clu_num == 0 || clu_num == -1)
153 if (++curr_num >= 10000)
154 die(
"Unable to create unique name");
161 int next_free = 0, scan;
172 if (next_free ==
fs->root_entries)
173 die(
"Root directory is full.");
174 offset =
fs->root_start + next_free *
sizeof(DIR_ENT);
175 memset(de, 0,
sizeof(DIR_ENT));
181 for (scan = 0; scan <
fs->root_entries; scan++)
182 if (scan != next_free &&
186 if (scan ==
fs->root_entries)
188 if (++curr_num >= 10000)
189 die(
"Unable to create unique name");
static HRESULT get_owner(VARIANT *user, VARIANT *domain, VARIANT *retval)
void set_fat(DOS_FS *fs, uint32_t cluster, int32_t new)
void fs_write(off_t pos, int size, void *data)
#define sprintf(buf, format,...)
uint32_t next_cluster(DOS_FS *fs, uint32_t cluster)
void fs_read(off_t pos, int size, void *data)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
void set_owner(DOS_FS *fs, uint32_t cluster, DOS_FILE *owner)
const char * root_entries[]
#define memcpy(s1, s2, n)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
off_t cluster_start(DOS_FS *fs, uint32_t cluster)
void get_fat(FAT_ENTRY *entry, void *fat, uint32_t cluster, DOS_FS *fs)