Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
30e388af
Commit
30e388af
authored
Mar 25, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strdup, implement MsiDatabaseImportA.
parent
852fc5f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
41 deletions
+44
-41
msi.c
dlls/msi/msi.c
+38
-28
record.c
dlls/msi/record.c
+6
-13
No files found.
dlls/msi/msi.c
View file @
30e388af
...
...
@@ -608,21 +608,17 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute,
LPSTR
szBuffer
,
DWORD
*
pcchValueBuf
)
{
LPWSTR
szwProduct
=
NULL
,
szwAttribute
=
NULL
,
szwBuffer
=
NULL
;
UINT
hr
=
ERROR_
INSTALL_FAILURE
;
UINT
hr
=
ERROR_
OUTOFMEMORY
;
FIXME
(
"%s %s %p %p
\n
"
,
debugstr_a
(
szProduct
),
debugstr_a
(
szAttribute
),
TRACE
(
"%s %s %p %p
\n
"
,
debugstr_a
(
szProduct
),
debugstr_a
(
szAttribute
),
szBuffer
,
pcchValueBuf
);
if
(
NULL
!=
szBuffer
&&
NULL
==
pcchValueBuf
)
return
ERROR_INVALID_PARAMETER
;
if
(
szProduct
)
{
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
goto
end
;
}
else
return
ERROR_INVALID_PARAMETER
;
if
(
szAttribute
)
{
...
...
@@ -630,11 +626,6 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute,
if
(
!
szwAttribute
)
goto
end
;
}
else
{
hr
=
ERROR_INVALID_PARAMETER
;
goto
end
;
}
if
(
szBuffer
)
{
...
...
@@ -679,40 +670,59 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
return
hr
;
}
UINT
WINAPI
MsiDatabaseImport
A
(
MSIHANDLE
handle
,
LPCSTR
szFolderPath
,
LPC
STR
szFilename
)
UINT
WINAPI
MsiDatabaseImport
W
(
MSIHANDLE
handle
,
LPCWSTR
szFolderPath
,
LPCW
STR
szFilename
)
{
FIXME
(
"%lx %s %s
\n
"
,
handle
,
debugstr_
a
(
szFolderPath
),
debugstr_a
(
szFilename
));
FIXME
(
"%lx %s %s
\n
"
,
handle
,
debugstr_
w
(
szFolderPath
),
debugstr_w
(
szFilename
));
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
UINT
WINAPI
MsiDatabaseImportW
(
MSIHANDLE
handle
,
LPCWSTR
szFolderPath
,
LPCWSTR
szFilename
)
UINT
WINAPI
MsiDatabaseImportA
(
MSIHANDLE
handle
,
LPCSTR
szFolderPath
,
LPCSTR
szFilename
)
{
FIXME
(
"%lx %s %s
\n
"
,
handle
,
debugstr_w
(
szFolderPath
),
debugstr_w
(
szFilename
));
return
ERROR_CALL_NOT_IMPLEMENTED
;
LPWSTR
path
=
NULL
,
file
=
NULL
;
UINT
r
=
ERROR_OUTOFMEMORY
;
TRACE
(
"%lx %s %s
\n
"
,
handle
,
debugstr_a
(
szFolderPath
),
debugstr_a
(
szFilename
));
if
(
szFolderPath
)
{
path
=
strdupAtoW
(
szFolderPath
);
if
(
!
path
)
goto
end
;
}
if
(
szFilename
)
{
file
=
strdupAtoW
(
szFilename
);
if
(
!
file
)
goto
end
;
}
r
=
MsiDatabaseImportW
(
handle
,
path
,
file
);
end:
HeapFree
(
GetProcessHeap
(),
0
,
path
);
HeapFree
(
GetProcessHeap
(),
0
,
file
);
return
r
;
}
UINT
WINAPI
MsiEnableLogA
(
DWORD
dwLogMode
,
LPCSTR
szLogFile
,
DWORD
attributes
)
{
LPWSTR
szwLogFile
=
NULL
;
UINT
hr
=
ERROR_INSTALL_FAILURE
;
UINT
r
;
FIXM
E
(
"%08lx %s %08lx
\n
"
,
dwLogMode
,
debugstr_a
(
szLogFile
),
attributes
);
TRAC
E
(
"%08lx %s %08lx
\n
"
,
dwLogMode
,
debugstr_a
(
szLogFile
),
attributes
);
if
(
szLogFile
)
{
szwLogFile
=
strdupAtoW
(
szLogFile
);
if
(
!
szwLogFile
)
goto
end
;
return
ERROR_OUTOFMEMORY
;
}
else
return
ERROR_INVALID_PARAMETER
;
hr
=
MsiEnableLogW
(
dwLogMode
,
szwLogFile
,
attributes
);
end:
r
=
MsiEnableLogW
(
dwLogMode
,
szwLogFile
,
attributes
);
HeapFree
(
GetProcessHeap
(),
0
,
szwLogFile
);
return
hr
;
return
r
;
}
UINT
WINAPI
MsiEnableLogW
(
DWORD
dwLogMode
,
LPCWSTR
szLogFile
,
DWORD
attributes
)
...
...
@@ -721,7 +731,7 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
TRACE
(
"%08lx %s %08lx
\n
"
,
dwLogMode
,
debugstr_w
(
szLogFile
),
attributes
);
strcpyW
(
gszLogFile
,
szLogFile
);
l
strcpyW
(
gszLogFile
,
szLogFile
);
if
(
!
(
attributes
&
INSTALLLOGATTRIBUTES_APPEND
))
DeleteFileW
(
szLogFile
);
file
=
CreateFileW
(
szLogFile
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_ALWAYS
,
...
...
dlls/msi/record.c
View file @
30e388af
...
...
@@ -448,7 +448,6 @@ UINT WINAPI MsiRecordDataSize(MSIHANDLE handle, unsigned int iField)
UINT
MSI_RecordSetStringA
(
MSIRECORD
*
rec
,
unsigned
int
iField
,
LPCSTR
szValue
)
{
LPWSTR
str
;
UINT
len
;
TRACE
(
"%p %d %s
\n
"
,
rec
,
iField
,
debugstr_a
(
szValue
));
...
...
@@ -458,9 +457,7 @@ UINT MSI_RecordSetStringA( MSIRECORD *rec, unsigned int iField, LPCSTR szValue )
MSI_FreeField
(
&
rec
->
fields
[
iField
]
);
if
(
szValue
&&
szValue
[
0
]
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szValue
,
-
1
,
NULL
,
0
);
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
szValue
,
-
1
,
str
,
len
);
str
=
strdupAtoW
(
szValue
);
rec
->
fields
[
iField
].
type
=
MSIFIELD_WSTR
;
rec
->
fields
[
iField
].
u
.
szwVal
=
str
;
}
...
...
@@ -493,7 +490,6 @@ UINT WINAPI MsiRecordSetStringA( MSIHANDLE handle, unsigned int iField, LPCSTR s
UINT
MSI_RecordSetStringW
(
MSIRECORD
*
rec
,
unsigned
int
iField
,
LPCWSTR
szValue
)
{
LPWSTR
str
;
UINT
len
;
TRACE
(
"%p %d %s
\n
"
,
rec
,
iField
,
debugstr_w
(
szValue
));
...
...
@@ -504,10 +500,7 @@ UINT MSI_RecordSetStringW( MSIRECORD *rec, unsigned int iField, LPCWSTR szValue
if
(
szValue
&&
szValue
[
0
]
)
{
len
=
lstrlenW
(
szValue
)
+
1
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
lstrcpyW
(
str
,
szValue
);
str
=
strdupW
(
szValue
);
rec
->
fields
[
iField
].
type
=
MSIFIELD_WSTR
;
rec
->
fields
[
iField
].
u
.
szwVal
=
str
;
}
...
...
@@ -633,15 +626,15 @@ UINT MSI_RecordSetStreamW(MSIRECORD *rec, unsigned int iField, LPCWSTR szFilenam
UINT
WINAPI
MsiRecordSetStreamA
(
MSIHANDLE
hRecord
,
unsigned
int
iField
,
LPCSTR
szFilename
)
{
LPWSTR
wstr
=
NULL
;
UINT
ret
,
len
;
UINT
ret
;
TRACE
(
"%ld %d %s
\n
"
,
hRecord
,
iField
,
debugstr_a
(
szFilename
));
if
(
szFilename
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szFilename
,
-
1
,
NULL
,
0
);
wstr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szFilename
,
-
1
,
wstr
,
len
)
;
wstr
=
strdupAtoW
(
szFilename
);
if
(
!
wstr
)
return
ERROR_OUTOFMEMORY
;
}
ret
=
MsiRecordSetStreamW
(
hRecord
,
iField
,
wstr
);
HeapFree
(
GetProcessHeap
(),
0
,
wstr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment