mshtml: Support returning VT_NULL from return_nsstr_variant.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
97b6b1e224
commit
fd44c7ac26
|
@ -926,12 +926,7 @@ UINT32 nsAString_GetData(const nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
|
||||||
void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN;
|
void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT return_nsstr(nsresult,nsAString*,BSTR*) DECLSPEC_HIDDEN;
|
HRESULT return_nsstr(nsresult,nsAString*,BSTR*) DECLSPEC_HIDDEN;
|
||||||
|
HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p) DECLSPEC_HIDDEN;
|
||||||
static inline HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p)
|
|
||||||
{
|
|
||||||
V_VT(p) = VT_BSTR;
|
|
||||||
return return_nsstr(nsres, nsstr, &V_BSTR(p));
|
|
||||||
}
|
|
||||||
|
|
||||||
nsICommandParams *create_nscommand_params(void) DECLSPEC_HIDDEN;
|
nsICommandParams *create_nscommand_params(void) DECLSPEC_HIDDEN;
|
||||||
HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN;
|
HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -69,6 +69,7 @@ static nsresult (CDECL *NS_CStringSetData)(nsACString*,const char*,PRUint32);
|
||||||
static nsresult (CDECL *NS_NewLocalFile)(const nsAString*,cpp_bool,nsIFile**);
|
static nsresult (CDECL *NS_NewLocalFile)(const nsAString*,cpp_bool,nsIFile**);
|
||||||
static PRUint32 (CDECL *NS_StringGetData)(const nsAString*,const PRUnichar **,cpp_bool*);
|
static PRUint32 (CDECL *NS_StringGetData)(const nsAString*,const PRUnichar **,cpp_bool*);
|
||||||
static PRUint32 (CDECL *NS_CStringGetData)(const nsACString*,const char**,cpp_bool*);
|
static PRUint32 (CDECL *NS_CStringGetData)(const nsACString*,const char**,cpp_bool*);
|
||||||
|
static cpp_bool (CDECL *NS_StringGetIsVoid)(const nsAString*);
|
||||||
static void* (CDECL *NS_Alloc)(SIZE_T);
|
static void* (CDECL *NS_Alloc)(SIZE_T);
|
||||||
static void (CDECL *NS_Free)(void*);
|
static void (CDECL *NS_Free)(void*);
|
||||||
|
|
||||||
|
@ -518,6 +519,7 @@ static BOOL load_xul(const PRUnichar *gre_path)
|
||||||
NS_DLSYM(NS_NewLocalFile);
|
NS_DLSYM(NS_NewLocalFile);
|
||||||
NS_DLSYM(NS_StringGetData);
|
NS_DLSYM(NS_StringGetData);
|
||||||
NS_DLSYM(NS_CStringGetData);
|
NS_DLSYM(NS_CStringGetData);
|
||||||
|
NS_DLSYM(NS_StringGetIsVoid);
|
||||||
NS_DLSYM(NS_Alloc);
|
NS_DLSYM(NS_Alloc);
|
||||||
NS_DLSYM(NS_Free);
|
NS_DLSYM(NS_Free);
|
||||||
NS_DLSYM(ccref_incr);
|
NS_DLSYM(ccref_incr);
|
||||||
|
@ -870,6 +872,38 @@ HRESULT return_nsstr(nsresult nsres, nsAString *nsstr, BSTR *p)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p)
|
||||||
|
{
|
||||||
|
const PRUnichar *str;
|
||||||
|
|
||||||
|
if(NS_FAILED(nsres)) {
|
||||||
|
ERR("failed: %08x\n", nsres);
|
||||||
|
nsAString_Finish(nsstr);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(NS_StringGetIsVoid(nsstr)) {
|
||||||
|
TRACE("ret null\n");
|
||||||
|
V_VT(p) = VT_NULL;
|
||||||
|
}else {
|
||||||
|
nsAString_GetData(nsstr, &str);
|
||||||
|
TRACE("ret %s\n", debugstr_w(str));
|
||||||
|
if(*str) {
|
||||||
|
V_BSTR(p) = SysAllocString(str);
|
||||||
|
if(!V_BSTR(p)) {
|
||||||
|
nsAString_Finish(nsstr);
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
V_BSTR(p) = NULL;
|
||||||
|
}
|
||||||
|
V_VT(p) = VT_BSTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsAString_Finish(nsstr);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsICommandParams *create_nscommand_params(void)
|
nsICommandParams *create_nscommand_params(void)
|
||||||
{
|
{
|
||||||
nsICommandParams *ret = NULL;
|
nsICommandParams *ret = NULL;
|
||||||
|
|
Loading…
Reference in New Issue