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
3a860194
Commit
3a860194
authored
Sep 16, 2002
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NetpGetComputerName, SHCopyKeyA and SHRegGetPathA don't exist on all
Windows platforms -> use GetModuleHandle + GetProcAddress.
parent
14fb0957
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
10 deletions
+33
-10
wksta.c
dlls/netapi32/tests/wksta.c
+15
-7
shreg.c
dlls/shlwapi/tests/shreg.c
+18
-3
No files found.
dlls/netapi32/tests/wksta.c
View file @
3a860194
...
...
@@ -27,16 +27,24 @@
#include "lmwksta.h"
#include "lmapibuf.h"
NET_API_STATUS
WINAPI
NetpGetComputerName
(
LPWSTR
*
Buffer
);
typedef
NET_API_STATUS
(
WINAPI
*
NetpGetComputerName_func
)
(
LPWSTR
*
Buffer
);
void
run_get_comp_name_tests
(
void
)
{
WCHAR
empty
[]
=
{
0
};
LPWSTR
ws
=
empty
;
ok
(
NetpGetComputerName
(
&
ws
)
==
NERR_Success
,
"Computer name is retrieved"
);
ok
(
ws
[
0
]
!=
0
,
"Some value is populated to the buffer"
);
NetApiBufferFree
(
ws
);
HANDLE
hnetapi32
=
GetModuleHandleA
(
"netapi32.dll"
);
if
(
hnetapi32
)
{
WCHAR
empty
[]
=
{
0
};
LPWSTR
ws
=
empty
;
NetpGetComputerName_func
pNetpGetComputerName
;
pNetpGetComputerName
=
(
NetpGetComputerName_func
)
GetProcAddress
(
hnetapi32
,
"NetpGetComputerName"
);
if
(
pNetpGetComputerName
)
{
ok
((
*
pNetpGetComputerName
)(
&
ws
)
==
NERR_Success
,
"Computer name is retrieved"
);
ok
(
ws
[
0
]
!=
0
,
"Some value is populated to the buffer"
);
NetApiBufferFree
(
ws
);
}
}
}
void
run_usergetinfo_tests
(
void
)
...
...
dlls/shlwapi/tests/shreg.c
View file @
3a860194
...
...
@@ -32,6 +32,12 @@
#define REG_TEST_KEY "Software\\Wine\\Test"
#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows NT\\CurrentVersion"
static
HMODULE
hshlwapi
;
typedef
DWORD
(
WINAPI
*
SHCopyKeyA_func
)(
HKEY
,
LPCSTR
,
HKEY
,
DWORD
);
static
SHCopyKeyA_func
pSHCopyKeyA
;
typedef
DWORD
(
WINAPI
*
SHRegGetPathA_func
)(
HKEY
,
LPCSTR
,
LPCSTR
,
LPSTR
,
DWORD
);
static
SHRegGetPathA_func
pSHRegGetPathA
;
static
char
*
sTestpath1
=
"%LONGSYSTEMVAR%
\\
subdir1"
;
static
char
*
sTestpath2
=
"%FOO%
\\
subdir1"
;
...
...
@@ -112,8 +118,11 @@ static void test_SHGetRegPath(void)
{
char
buf
[
MAX_PATH
];
if
(
!
pSHRegGetPathA
)
return
;
strcpy
(
buf
,
sEmptyBuffer
);
ok
(
!
SHRegGetPathA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
buf
,
0
),
"SHRegGetPathA failed"
);
ok
(
!
(
*
pSHRegGetPathA
)
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
buf
,
0
),
"SHRegGetPathA failed"
);
ok
(
0
==
strcmp
(
sExpTestpath1
,
buf
)
,
"(%s)"
,
buf
);
}
...
...
@@ -214,7 +223,6 @@ static void test_SHQUeryValueEx(void)
RegCloseKey
(
hKey
);
}
static
void
test_SHCopyKey
(
void
)
{
HKEY
hKeySrc
,
hKeyDst
;
...
...
@@ -242,7 +250,8 @@ static void test_SHCopyKey(void)
}
ok
(
!
SHCopyKeyA
(
hKeyDst
,
NULL
,
hKeySrc
,
0
),
"failed copy"
);
if
(
pSHCopyKeyA
)
ok
(
!
(
*
pSHCopyKeyA
)(
hKeyDst
,
NULL
,
hKeySrc
,
0
),
"failed copy"
);
RegCloseKey
(
hKeySrc
);
RegCloseKey
(
hKeyDst
);
...
...
@@ -265,6 +274,12 @@ static void test_SHCopyKey(void)
START_TEST
(
shreg
)
{
HKEY
hkey
=
create_test_entries
();
hshlwapi
=
GetModuleHandleA
(
"shlwapi.dll"
);
if
(
hshlwapi
)
{
pSHCopyKeyA
=
(
SHCopyKeyA_func
)
GetProcAddress
(
hshlwapi
,
"SHCopyKeyA"
);
pSHRegGetPathA
=
(
SHRegGetPathA_func
)
GetProcAddress
(
hshlwapi
,
"SHRegGetPathA"
);
}
test_SHGetValue
();
test_SHQUeryValueEx
();
test_SHGetRegPath
();
...
...
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