Skip to content

Commit c7b2548

Browse files
committed
-sync netapi32 with wine 1.1.32
svn path=/trunk/; revision=43750
1 parent 5b1a765 commit c7b2548

File tree

6 files changed

+47
-22
lines changed

6 files changed

+47
-22
lines changed

reactos/dll/win32/netapi32/access.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static BOOL NETAPI_IsCurrentUser(LPCWSTR username)
112112
BOOL ret = FALSE;
113113

114114
dwSize = LM20_UNLEN+1;
115-
curr_user = HeapAlloc(GetProcessHeap(), 0, dwSize);
115+
curr_user = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR));
116116
if(!curr_user)
117117
{
118118
ERR("Failed to allocate memory for user name.\n");
@@ -431,7 +431,7 @@ NetUserGetLocalGroups(LPCWSTR servername, LPCWSTR username, DWORD level,
431431
return status;
432432

433433
size = UNLEN + 1;
434-
NetApiBufferAllocate(size, (LPVOID*)&currentuser);
434+
NetApiBufferAllocate(size * sizeof(WCHAR), (LPVOID*)&currentuser);
435435
GetUserNameW(currentuser, &size);
436436

437437
if (lstrcmpiW(username, currentuser) && NETAPI_FindUser(username))
@@ -640,7 +640,7 @@ NetQueryDisplayInformation(
640640

641641
/* get data */
642642
dwSize = UNLEN + 1;
643-
NetApiBufferAllocate(dwSize, (LPVOID *) &name);
643+
NetApiBufferAllocate(dwSize * sizeof(WCHAR), (LPVOID *) &name);
644644
if (!GetUserNameW(name, &dwSize))
645645
{
646646
NetApiBufferFree(name);
@@ -731,6 +731,16 @@ NetGroupEnum(LPCWSTR servername, DWORD level, LPBYTE *bufptr, DWORD prefmaxlen,
731731
return ERROR_ACCESS_DENIED;
732732
}
733733

734+
/************************************************************
735+
* NetGroupGetInfo (NETAPI32.@)
736+
*
737+
*/
738+
NET_API_STATUS WINAPI NetGroupGetInfo(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE *bufptr)
739+
{
740+
FIXME("(%s, %s, %d, %p) stub!\n", debugstr_w(servername), debugstr_w(groupname), level, bufptr);
741+
return ERROR_ACCESS_DENIED;
742+
}
743+
734744
/******************************************************************************
735745
* NetUserModalsGet (NETAPI32.@)
736746
*

reactos/dll/win32/netapi32/nbt.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,8 +1478,7 @@ void NetBTInit(void)
14781478
gBCastQueries = dword;
14791479
size = sizeof(dword);
14801480
if (RegQueryValueExW(hKey, BcastNameQueryTimeoutW, NULL, NULL,
1481-
(LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT
1482-
&& dword <= MAX_QUERY_TIMEOUT)
1481+
(LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT)
14831482
gBCastQueryTimeout = dword;
14841483
size = sizeof(dword);
14851484
if (RegQueryValueExW(hKey, NameSrvQueryCountW, NULL, NULL,
@@ -1488,8 +1487,7 @@ void NetBTInit(void)
14881487
gWINSQueries = dword;
14891488
size = sizeof(dword);
14901489
if (RegQueryValueExW(hKey, NameSrvQueryTimeoutW, NULL, NULL,
1491-
(LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT
1492-
&& dword <= MAX_QUERY_TIMEOUT)
1490+
(LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT)
14931491
gWINSQueryTimeout = dword;
14941492
size = sizeof(gScopeID) - 1;
14951493
if (RegQueryValueExW(hKey, ScopeIDW, NULL, NULL, (LPBYTE)gScopeID + 1, &size)

reactos/dll/win32/netapi32/netapi32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ NET_API_STATUS WINAPI NetServerEnumEx(
9797
*/
9898
NET_API_STATUS WINAPI NetServerGetInfo(LMSTR servername, DWORD level, LPBYTE* bufptr)
9999
{
100-
FIXME("stub (%p, %d, %p)\n", servername, level, bufptr);
100+
FIXME("stub (%s, %d, %p)\n", debugstr_w(servername), level, bufptr);
101101
return ERROR_ACCESS_DENIED;
102102
}
103103

reactos/dll/win32/netapi32/netapi32.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
@ stub NetErrorLogRead
8989
@ stub NetErrorLogWrite
9090
@ stub NetFileClose
91-
@ stub NetFileEnum
91+
@ stdcall NetFileEnum(wstr wstr wstr long ptr long ptr ptr ptr)
9292
@ stub NetFileGetInfo
9393
@ stub NetGetAnyDCName
9494
@ stdcall NetGetDCName(wstr wstr ptr)
@@ -99,7 +99,7 @@
9999
@ stub NetGroupDel
100100
@ stub NetGroupDelUser
101101
@ stdcall NetGroupEnum(wstr long ptr long ptr ptr ptr)
102-
@ stub NetGroupGetInfo
102+
@ stdcall NetGroupGetInfo(wstr wstr long ptr)
103103
@ stub NetGroupGetUsers
104104
@ stub NetGroupSetInfo
105105
@ stub NetGroupSetUsers

reactos/dll/win32/netapi32/share.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,16 @@ NET_API_STATUS WINAPI NetShareAdd(LMSTR servername,
113113
FIXME("Stub (%s %d %p %p)\n", debugstr_w(servername), level, buf, parm_err);
114114
return ERROR_NOT_SUPPORTED;
115115
}
116+
117+
/************************************************************
118+
* NetFileEnum (NETAPI32.@)
119+
*/
120+
NET_API_STATUS WINAPI NetFileEnum(
121+
LPWSTR ServerName, LPWSTR BasePath, LPWSTR UserName,
122+
DWORD Level, LPBYTE* BufPtr, DWORD PrefMaxLen,
123+
LPDWORD EntriesRead, LPDWORD TotalEntries, PDWORD_PTR ResumeHandle)
124+
{
125+
FIXME("(%s, %s, %s, %u): stub\n", debugstr_w(ServerName), debugstr_w(BasePath),
126+
debugstr_w(UserName), Level);
127+
return ERROR_NOT_SUPPORTED;
128+
}

reactos/include/psdk/lmshare.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,24 @@ typedef struct _CONNECTION_INFO_1 {
123123
LPWSTR coni1_username;
124124
LPWSTR coni1_netname;
125125
} CONNECTION_INFO_1,*PCONNECTION_INFO_1,*LPCONNECTION_INFO_1;
126-
NET_API_STATUS WINAPI NetShareAdd(LPWSTR,DWORD,PBYTE,PDWORD);
127-
NET_API_STATUS WINAPI NetShareEnum(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
128-
NET_API_STATUS WINAPI NetShareEnumSticky(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD resume_handle);
129-
NET_API_STATUS WINAPI NetShareGetInfo(LPWSTR,LPWSTR,DWORD,PBYTE*);
130-
NET_API_STATUS WINAPI NetShareSetInfo(LPWSTR,LPWSTR,DWORD,PBYTE,PDWORD);
131-
NET_API_STATUS WINAPI NetShareDel(LPWSTR,LPWSTR,DWORD);
132-
NET_API_STATUS WINAPI NetShareDelSticky(LPWSTR,LPWSTR,DWORD);
133-
NET_API_STATUS WINAPI NetShareCheck(LPWSTR,LPWSTR,PDWORD);
134-
NET_API_STATUS WINAPI NetSessionEnum(LPWSTR,LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
135-
NET_API_STATUS WINAPI NetSessionDel(LPWSTR,LPWSTR,LPWSTR);
136-
NET_API_STATUS WINAPI NetSessionGetInfo(LPWSTR,LPWSTR,LPWSTR,DWORD,PBYTE*);
126+
127+
NET_API_STATUS WINAPI NetShareAdd(LMSTR,DWORD,LPBYTE,LPDWORD);
128+
NET_API_STATUS WINAPI NetShareCheck(LMSTR,LMSTR,LPDWORD);
129+
NET_API_STATUS WINAPI NetShareDel(LMSTR,LMSTR,DWORD);
130+
NET_API_STATUS WINAPI NetShareDelEx(LMSTR,DWORD,LPBYTE);
131+
NET_API_STATUS WINAPI NetShareDelSticky(LMSTR,LMSTR,DWORD);
132+
NET_API_STATUS WINAPI NetShareEnum(LMSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,LPDWORD);
133+
NET_API_STATUS WINAPI NetShareEnumSticky(LMSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,LPDWORD);
134+
NET_API_STATUS WINAPI NetShareGetInfo(LMSTR,LMSTR,DWORD,LPBYTE*);
135+
NET_API_STATUS WINAPI NetShareSetInfo(LMSTR,LMSTR,DWORD,LPBYTE,LPDWORD);
136+
137+
NET_API_STATUS WINAPI NetSessionDel(LMSTR,LMSTR,LMSTR);
138+
NET_API_STATUS WINAPI NetSessionEnum(LMSTR,LMSTR,LMSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,LPDWORD);
139+
NET_API_STATUS WINAPI NetSessionGetInfo(LMSTR,LMSTR,LMSTR,DWORD,LPBYTE*);
140+
137141
NET_API_STATUS WINAPI NetConnectionEnum(LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
138142
NET_API_STATUS WINAPI NetFileClose(LPWSTR,DWORD);
139-
NET_API_STATUS WINAPI NetFileEnum(LPWSTR,LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
143+
NET_API_STATUS WINAPI NetFileEnum(LMSTR,LMSTR,LMSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD_PTR);
140144
NET_API_STATUS WINAPI NetFileGetInfo(LPWSTR,DWORD,DWORD,PBYTE*);
141145
#ifdef __cplusplus
142146
}

0 commit comments

Comments
 (0)