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
65fb0918
Commit
65fb0918
authored
Feb 08, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement and document MsiLoadString.
parent
e0803f1a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
10 deletions
+150
-10
.cvsignore
dlls/msi/.cvsignore
+1
-1
Makefile.in
dlls/msi/Makefile.in
+1
-1
msi.c
dlls/msi/msi.c
+85
-8
msi.rc
dlls/msi/msi.rc
+30
-0
msi_En.rc
dlls/msi/msi_En.rc
+33
-0
No files found.
dlls/msi/.cvsignore
View file @
65fb0918
...
...
@@ -2,7 +2,7 @@ Makefile
cond.tab.c
cond.tab.h
msi.dll.dbg.c
msi.res
msi.spec.def
sql.tab.c
sql.tab.h
version.res
dlls/msi/Makefile.in
View file @
65fb0918
...
...
@@ -32,7 +32,7 @@ C_SRCS = \
update.c
\
where.c
RC_SRCS
=
version
.rc
RC_SRCS
=
msi
.rc
EXTRA_SRCS
=
sql.y cond.y
EXTRA_OBJS
=
sql.tab.o cond.tab.o
...
...
dlls/msi/msi.c
View file @
65fb0918
...
...
@@ -62,6 +62,7 @@ INSTALLUI_HANDLERW gUIHandlerW = NULL;
DWORD
gUIFilter
=
0
;
LPVOID
gUIContext
=
NULL
;
WCHAR
gszLogFile
[
MAX_PATH
];
HINSTANCE
msi_hInstance
;
/*
* .MSI file format
...
...
@@ -848,18 +849,93 @@ INSTALLUI_HANDLERW WINAPI MsiSetExternalUIW(INSTALLUI_HANDLERW puiHandler,
return
prev
;
}
UINT
WINAPI
MsiLoadStringA
(
HINSTANCE
hInstance
,
UINT
uID
,
LPSTR
lpBuffer
,
int
nBufferMax
,
DWORD
e
)
/******************************************************************
* MsiLoadStringW [MSI.@]
*
* Loads a string from MSI's string resources.
*
* PARAMS
*
* handle [I] only -1 is handled currently
* id [I] id of the string to be loaded
* lpBuffer [O] buffer for the string to be written to
* nBufferMax [I] maximum size of the buffer in characters
* lang [I] the prefered language for the string
*
* RETURNS
*
* If successful, this function returns the language id of the string loaded
* If the function fails, the function returns zero.
*
* NOTES
*
* The type of the first parameter is unknown. LoadString's prototype
* suggests that it might be a module handle. I have made it an MSI handle
* for starters, as -1 is an invalid MSI handle, but not an invalid module
* handle. Maybe strings can be stored in an MSI database somehow.
*/
LANGID
WINAPI
MsiLoadStringW
(
MSIHANDLE
handle
,
UINT
id
,
LPWSTR
lpBuffer
,
int
nBufferMax
,
LANGID
lang
)
{
FIXME
(
"%p %u %p %d %08lx
\n
"
,
hInstance
,
uID
,
lpBuffer
,
nBufferMax
,
e
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
HRSRC
hres
;
HGLOBAL
hResData
;
LPWSTR
p
;
DWORD
i
,
len
;
TRACE
(
"%ld %u %p %d %d
\n
"
,
handle
,
id
,
lpBuffer
,
nBufferMax
,
lang
);
if
(
handle
!=
-
1
)
FIXME
(
"don't know how to deal with handle = %08lx
\n
"
,
handle
);
if
(
!
lang
)
lang
=
GetUserDefaultLangID
();
hres
=
FindResourceExW
(
msi_hInstance
,
(
LPCWSTR
)
RT_STRING
,
(
LPWSTR
)
1
,
lang
);
if
(
!
hres
)
return
0
;
hResData
=
LoadResource
(
msi_hInstance
,
hres
);
if
(
!
hResData
)
return
0
;
p
=
LockResource
(
hResData
);
if
(
!
p
)
return
0
;
for
(
i
=
0
;
i
<
(
id
&
0xf
);
i
++
)
p
+=
*
p
+
1
;
len
=
*
p
;
if
(
nBufferMax
<=
len
)
return
0
;
memcpy
(
lpBuffer
,
p
+
1
,
len
*
sizeof
(
WCHAR
));
lpBuffer
[
len
]
=
0
;
TRACE
(
"found -> %s
\n
"
,
debugstr_w
(
lpBuffer
));
return
lang
;
}
UINT
WINAPI
MsiLoadStringW
(
HINSTANCE
hInstance
,
UINT
uID
,
LPW
STR
lpBuffer
,
int
nBufferMax
,
DWORD
e
)
LANGID
WINAPI
MsiLoadStringA
(
MSIHANDLE
handle
,
UINT
id
,
LP
STR
lpBuffer
,
int
nBufferMax
,
LANGID
lang
)
{
FIXME
(
"%p %u %p %d %08lx
\n
"
,
hInstance
,
uID
,
lpBuffer
,
nBufferMax
,
e
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
LPWSTR
bufW
;
LANGID
r
;
DWORD
len
;
bufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nBufferMax
*
sizeof
(
WCHAR
));
r
=
MsiLoadStringW
(
handle
,
id
,
bufW
,
nBufferMax
,
lang
);
if
(
r
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
len
<=
nBufferMax
)
WideCharToMultiByte
(
CP_ACP
,
0
,
bufW
,
-
1
,
lpBuffer
,
nBufferMax
,
NULL
,
NULL
);
else
r
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
bufW
);
return
r
;
}
INSTALLSTATE
WINAPI
MsiLocateComponentA
(
LPCSTR
szComponent
,
LPSTR
lpPathBuf
,
...
...
@@ -1466,6 +1542,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
msi_hInstance
=
hinstDLL
;
DisableThreadLibraryCalls
(
hinstDLL
);
msi_dialog_register_class
();
break
;
...
...
dlls/msi/msi.rc
0 → 100644
View file @
65fb0918
/*
* Resources for MSI
*
* Copyright 2005 Mike McCormack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "version.rc"
#include "msi_En.rc"
dlls/msi/msi_En.rc
0 → 100644
View file @
65fb0918
/*
* English resources for MSI
*
* Copyright 2005 Mike McCormack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
5 "path %s not found"
9 "insert disk %s"
10 "bad parameters"
11 "enter which folder contains %s"
12 "install source for feature missing"
13 "network drive for feature missing"
14 "feature from:"
15 "choose which folder contains %s"
}
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