2 * Copyright 2015 Michael Müller
3 * Copyright 2015 Sebastian Lackner
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 ASSEMBLY_STATUS_IN_PROGRESS
,
24 ASSEMBLY_STATUS_INSTALLED
,
27 struct assembly_identity
36 struct dependency_entry
39 struct assembly_identity identity
;
49 struct registrykv_entry
57 struct registryop_entry
61 struct list keyvalues
;
70 struct assembly_identity identity
;
71 struct list dependencies
;
73 struct list registryops
;
76 void free_assembly(struct assembly_entry
*entry
) DECLSPEC_HIDDEN
;
77 void free_dependency(struct dependency_entry
*entry
) DECLSPEC_HIDDEN
;
78 struct assembly_entry
*load_manifest(const WCHAR
*filename
) DECLSPEC_HIDDEN
;
79 BOOL
load_update(const WCHAR
*filename
, struct list
*update_list
) DECLSPEC_HIDDEN
;
81 static void *heap_alloc(size_t len
) __WINE_ALLOC_SIZE(1);
82 static inline void *heap_alloc(size_t len
)
84 return HeapAlloc(GetProcessHeap(), 0, len
);
87 static void *heap_alloc_zero(size_t len
) __WINE_ALLOC_SIZE(1);
88 static inline void *heap_alloc_zero(size_t len
)
90 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
93 static void *heap_realloc(void *mem
, size_t len
) __WINE_ALLOC_SIZE(2);
94 static inline void *heap_realloc(void *mem
, size_t len
)
96 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
99 static inline BOOL
heap_free(void *mem
)
101 return HeapFree(GetProcessHeap(), 0, mem
);
104 static inline char *strdupWtoA(const WCHAR
*str
)
109 if (!str
) return ret
;
110 len
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
111 if ((ret
= heap_alloc(len
)))
112 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, len
, NULL
, NULL
);
116 static inline WCHAR
*strdupAtoW(const char *str
)
121 if (!str
) return ret
;
122 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
123 if ((ret
= heap_alloc(len
* sizeof(WCHAR
))))
124 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
128 static inline WCHAR
*strdupW(const WCHAR
*str
)
131 if (!str
) return NULL
;
132 ret
= heap_alloc((lstrlenW(str
) + 1) * sizeof(WCHAR
));
133 if (ret
) lstrcpyW(ret
, str
);
137 static inline WCHAR
*strdupWn(const WCHAR
*str
, DWORD len
)
140 if (!str
) return NULL
;
141 ret
= heap_alloc((len
+ 1) * sizeof(WCHAR
));
144 memcpy(ret
, str
, len
* sizeof(WCHAR
));