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
ab418fc2
Commit
ab418fc2
authored
Jul 21, 2010
by
Andrew Eikum
Committed by
Alexandre Julliard
Jul 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Implement SHSetIniStringW.
parent
ef8cf0fd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
9 deletions
+78
-9
ordinal.c
dlls/shlwapi/ordinal.c
+17
-9
ordinal.c
dlls/shlwapi/tests/ordinal.c
+61
-0
No files found.
dlls/shlwapi/ordinal.c
View file @
ab418fc2
...
...
@@ -3292,18 +3292,26 @@ DWORD WINAPI SHGetIniStringW(LPCWSTR appName, LPCWSTR keyName, LPWSTR out,
/*************************************************************************
* @ [SHLWAPI.295]
*
* Called by ICQ2000b install via SHDOCVW:
* str1: "InternetShortcut"
* x: some unknown pointer
* str2: "http://free.aol.com/tryaolfree/index.adp?139269"
* str3: "C:\\WINDOWS\\Desktop.new2\\Free AOL & Unlimited Internet.url"
* Set a key value in an INI file. See WritePrivateProfileString for
* more information.
*
* PARAMS
* appName [I] The section in the INI file that contains the key
* keyName [I] The key to be set
* str [O] The value of the key
* filename [I] The location of the INI file
*
* In short: this one maybe creates a desktop link :-)
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL
WINAPI
SHSetIniStringW
(
LPWSTR
str1
,
LPVOID
x
,
LPWSTR
str2
,
LPWSTR
str3
)
BOOL
WINAPI
SHSetIniStringW
(
LPCWSTR
appName
,
LPCWSTR
keyName
,
LPCWSTR
str
,
LPCWSTR
filename
)
{
FIXME
(
"(%s, %p, %s, %s), stub.
\n
"
,
debugstr_w
(
str1
),
x
,
debugstr_w
(
str2
),
debugstr_w
(
str3
));
return
TRUE
;
TRACE
(
"(%s, %p, %s, %s)
\n
"
,
debugstr_w
(
appName
),
keyName
,
debugstr_w
(
str
),
debugstr_w
(
filename
));
return
WritePrivateProfileStringW
(
appName
,
keyName
,
str
,
filename
);
}
/*************************************************************************
...
...
dlls/shlwapi/tests/ordinal.c
View file @
ab418fc2
...
...
@@ -59,6 +59,7 @@ static HRESULT (WINAPI *pIUnknown_ProfferService)(IUnknown*, REFGUID, IServicePr
static
HWND
(
WINAPI
*
pSHCreateWorkerWindowA
)(
LONG
,
HWND
,
DWORD
,
DWORD
,
HMENU
,
LONG_PTR
);
static
HRESULT
(
WINAPI
*
pSHIShellFolder_EnumObjects
)(
LPSHELLFOLDER
,
HWND
,
SHCONTF
,
IEnumIDList
**
);
static
DWORD
(
WINAPI
*
pSHGetIniStringW
)(
LPCWSTR
,
LPCWSTR
,
LPWSTR
,
DWORD
,
LPCWSTR
);
static
BOOL
(
WINAPI
*
pSHSetIniStringW
)(
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
LPCWSTR
);
static
HMODULE
hmlang
;
static
HRESULT
(
WINAPI
*
pLcidToRfc1766A
)(
LCID
,
LPSTR
,
INT
);
...
...
@@ -2545,6 +2546,26 @@ static void write_inifile(LPCWSTR filename)
CloseHandle
(
file
);
}
#define verify_inifile(f, e) r_verify_inifile(__LINE__, f, e)
static
void
r_verify_inifile
(
unsigned
l
,
LPCWSTR
filename
,
LPCSTR
exp
)
{
HANDLE
file
;
CHAR
buf
[
1024
];
DWORD
read
;
file
=
CreateFileW
(
filename
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
return
;
ReadFile
(
file
,
buf
,
sizeof
(
buf
)
*
sizeof
(
CHAR
),
&
read
,
NULL
);
buf
[
read
]
=
'\0'
;
CloseHandle
(
file
);
ok_
(
__FILE__
,
l
)(
!
strcmp
(
buf
,
exp
),
"Expected:
\n
%s
\n
Got:
\n
%s
\n
"
,
exp
,
buf
);
}
static
void
test_SHGetIniString
(
void
)
{
DWORD
ret
;
...
...
@@ -2599,6 +2620,44 @@ static void test_SHGetIniString(void)
DeleteFileW
(
TestIniW
);
}
static
void
test_SHSetIniString
(
void
)
{
BOOL
ret
;
static
const
WCHAR
TestAppW
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'A'
,
'p'
,
'p'
,
0
};
static
const
WCHAR
AnotherAppW
[]
=
{
'A'
,
'n'
,
'o'
,
't'
,
'h'
,
'e'
,
'r'
,
'A'
,
'p'
,
'p'
,
0
};
static
const
WCHAR
TestIniW
[]
=
{
'C'
,
':'
,
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'i'
,
'n'
,
'i'
,
0
};
static
const
WCHAR
AKeyW
[]
=
{
'A'
,
'K'
,
'e'
,
'y'
,
0
};
static
const
WCHAR
NewKeyW
[]
=
{
'N'
,
'e'
,
'w'
,
'K'
,
'e'
,
'y'
,
0
};
static
const
WCHAR
AValueW
[]
=
{
'A'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
0
};
if
(
!
pSHSetIniStringW
||
is_win2k_and_lower
){
win_skip
(
"SHSetIniStringW is not available
\n
"
);
return
;
}
write_inifile
(
TestIniW
);
ret
=
pSHSetIniStringW
(
TestAppW
,
AKeyW
,
AValueW
,
TestIniW
);
ok
(
ret
==
TRUE
,
"SHSetIniStringW should not have failed
\n
"
);
todo_wine
/* wine sticks an extra \r\n at the end of the file */
verify_inifile
(
TestIniW
,
"[TestApp]
\r\n
AKey=AValue
\r\n
AnotherKey=asdf
\r\n
"
);
ret
=
pSHSetIniStringW
(
TestAppW
,
AKeyW
,
NULL
,
TestIniW
);
ok
(
ret
==
TRUE
,
"SHSetIniStringW should not have failed
\n
"
);
verify_inifile
(
TestIniW
,
"[TestApp]
\r\n
AnotherKey=asdf
\r\n
"
);
ret
=
pSHSetIniStringW
(
AnotherAppW
,
NewKeyW
,
AValueW
,
TestIniW
);
ok
(
ret
==
TRUE
,
"SHSetIniStringW should not have failed
\n
"
);
verify_inifile
(
TestIniW
,
"[TestApp]
\r\n
AnotherKey=asdf
\r\n
[AnotherApp]
\r\n
NewKey=AValue
\r\n
"
);
ret
=
pSHSetIniStringW
(
TestAppW
,
NULL
,
AValueW
,
TestIniW
);
ok
(
ret
==
TRUE
,
"SHSetIniStringW should not have failed
\n
"
);
verify_inifile
(
TestIniW
,
"[AnotherApp]
\r\n
NewKey=AValue
\r\n
"
);
DeleteFileW
(
TestIniW
);
}
static
void
init_pointers
(
void
)
{
#define MAKEFUNC(f, ord) (p##f = (void*)GetProcAddress(hShlwapi, (LPSTR)(ord)))
...
...
@@ -2616,6 +2675,7 @@ static void init_pointers(void)
MAKEFUNC
(
IConnectionPoint_InvokeWithCancel
,
283
);
MAKEFUNC
(
IConnectionPoint_SimpleInvoke
,
284
);
MAKEFUNC
(
SHGetIniStringW
,
294
);
MAKEFUNC
(
SHSetIniStringW
,
295
);
MAKEFUNC
(
SHFormatDateTimeA
,
353
);
MAKEFUNC
(
SHFormatDateTimeW
,
354
);
MAKEFUNC
(
SHIShellFolder_EnumObjects
,
404
);
...
...
@@ -2653,4 +2713,5 @@ START_TEST(ordinal)
test_SHCreateWorkerWindowA
();
test_SHIShellFolder_EnumObjects
();
test_SHGetIniString
();
test_SHSetIniString
();
}
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