Re: msi: Implement MsiDatabaseImport [try2]
28 Sep
2006
28 Sep
'06
11:52 a.m.
"James Hawkins" <truiken(a)gmail.com> writes:
+static LPWSTR msi_read_text_archive(LPCWSTR path) { - FIXME("%p %s %s\n", db, debugstr_w(folder), debugstr_w(file) ); + HANDLE file; + LPSTR data = NULL; + DWORD read, size = 0; + + file = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); + if (file == INVALID_HANDLE_VALUE) + return NULL; + + size = GetFileSize( file, NULL ); + data = msi_alloc( size + 1 ); + if (!data) + return NULL; + + if (!ReadFile( file, data, size, &read, NULL )) + return NULL; + + data[size] = '\0'; + return strdupAtoW( data ); +}
You're leaking both the file and the ascii string. -- Alexandre Julliard julliard(a)winehq.org
7018
Age (days ago)
7018
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard