113 if( st->
strings[
i].persistent_refcount ||
114 st->
strings[
i].nonpersistent_refcount )
131 for(
i = st->
freeslot; i < st->maxcount;
i++ )
132 if( !st->
strings[
i].persistent_refcount &&
133 !st->
strings[
i].nonpersistent_refcount )
137 if( !st->
strings[
i].persistent_refcount &&
138 !st->
strings[
i].nonpersistent_refcount )
159 ERR(
"oops. expected freeslot to be free...\n");
165 if (len1 < len2)
return -1;
166 else if (len1 > len2)
return 1;
169 if (*str1 == *str2) { str1++; str2++; }
170 else return *str1 - *str2;
182 i = (low + high) / 2;
213 st->
strings[
n].persistent_refcount = refcount;
214 st->
strings[
n].nonpersistent_refcount = 0;
218 st->
strings[
n].persistent_refcount = 0;
219 st->
strings[
n].nonpersistent_refcount = refcount;
227 if( n < st->maxcount )
266 if( st->
strings[
n].persistent_refcount ||
267 st->
strings[
n].nonpersistent_refcount )
275 st->
strings[
n].persistent_refcount += refcount;
277 st->
strings[
n].nonpersistent_refcount += refcount;
319 st->
strings[
n].persistent_refcount++;
321 st->
strings[
n].nonpersistent_refcount++;
353 if(
id && !st->
strings[
id].persistent_refcount && !st->
strings[
id].nonpersistent_refcount)
408 i = (low + high) / 2;
428 if( st->
strings[0].data || st->
strings[0].persistent_refcount || st->
strings[0].nonpersistent_refcount)
429 ERR(
"oops. element 0 has a string\n");
436 if( !st->
strings[
i].persistent_refcount )
451 (*poolsize) += holesize + 4;
493 if ( (poolsize > 4) && (
pool[1] & 0x8000) )
496 *bytes_per_strref =
sizeof(
USHORT);
516 if (
pool[
i*2] == 0 && refs == 0)
541 ERR(
"string table corrupt?\n");
547 ERR(
"Failed to add string %lu\n",
n );
553 ERR(
"string table load failed! (%u != %lu), please report\n",
datasize,
offset );
581 WARN(
"Failed to alloc pool %d bytes\n", poolsize );
601 *bytes_per_strref =
sizeof(
USHORT);
606 if( !st->
strings[
i].persistent_refcount )
618 ERR(
"failed to fetch string\n");
634 pool[
n*2 + 2 ] = sz&0xffff;
635 pool[
n*2 + 3 ] = (sz>>16);
654 TRACE(
"Wrote StringData r=%08x\n",
r);
658 TRACE(
"Wrote StringPool r=%08x\n",
r);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INVALID_PARAMETER
#define WideCharToMultiByte
#define MultiByteToWideChar
BOOL WINAPI IsValidCodePage(UINT codepage)
UINT msi_string2id(const string_table *st, const WCHAR *str, int len, UINT *id)
static UINT id2string(const string_table *st, UINT id, char *buffer, UINT *sz)
UINT msi_get_string_table_codepage(const string_table *st)
static int cmp_string(const WCHAR *str1, int len1, const WCHAR *str2, int len2)
static BOOL validate_codepage(UINT codepage)
static int add_string(string_table *st, UINT n, const char *data, UINT len, USHORT refcount, BOOL persistent)
static string_table * init_stringtable(int entries, UINT codepage)
static int st_find_free_entry(string_table *st)
static void string_totalsize(const string_table *st, UINT *datasize, UINT *poolsize)
HRESULT msi_init_string_table(IStorage *stg)
static void insert_string_sorted(string_table *st, UINT string_id)
string_table * msi_load_string_table(IStorage *stg, UINT *bytes_per_strref)
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len)
VOID msi_destroy_stringtable(string_table *st)
UINT msi_save_string_table(const string_table *st, IStorage *storage, UINT *bytes_per_strref)
UINT msi_set_string_table_codepage(string_table *st, UINT codepage)
static int find_insert_index(const string_table *st, UINT string_id)
static void set_st_entry(string_table *st, UINT n, WCHAR *str, int len, USHORT refcount, BOOL persistent)
int msi_add_string(string_table *st, const WCHAR *data, int len, BOOL persistent)
static UINT string2id(const string_table *st, const char *buffer, UINT *id)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
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
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
static void * msi_realloc(void *mem, size_t len) __WINE_ALLOC_SIZE(2)
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
static void msi_free(void *mem)
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
UINT write_stream_data(IStorage *stg, LPCWSTR stname, LPCVOID data, UINT sz, BOOL bTable) DECLSPEC_HIDDEN
USHORT nonpersistent_refcount
USHORT persistent_refcount
struct msistring * strings
#define ERROR_FUNCTION_FAILED