tengo este programa en el cual quiero implementar una función api de windows
necesito verificar que los primeros dos parametros son en Wide, ver si es posible usar el conocido hb_parc, lo otro es ver si funciona, no se como seria sacar la info, me parece que lo mejor es crear un array, pero no he sacado ni un valor aun.
gracias
carlos
- Code: Select all Expand view RUN
- procedure main()
?NetGroupGetUsers( NIL, "Usuarios" )
return
#pragma BEGINDUMP
#include <windows.h>
#include <lmaccess.h>
#include "hbapi.h"
#include "hbvm.h"
#include "hbapiitm.h"
void DimeC( char *szText )
{
MessageBox( NULL, szText, "Debug", MB_ICONINFORMATION|MB_SYSTEMMODAL );
}
void DimeN( LONG lNum )
{
char szBuffer[ 80 ];
wsprintf( szBuffer, "%ld", lNum );
DimeC( szBuffer );
}
/*
NET_API_STATUS NET_API_FUNCTION NetGroupGetUsers(
LPCWSTR servername,
LPCWSTR groupname,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
PDWORD_PTR ResumeHandle );
typedef struct _GROUP_USERS_INFO_0 {
LPWSTR grui0_name;
} GROUP_USERS_INFO_0, *PGROUP_USERS_INFO_0, *LPGROUP_USERS_INFO_0;
typedef struct _GROUP_USERS_INFO_1 {
LPWSTR grui1_name;
DWORD grui1_attributes;
} GROUP_USERS_INFO_1, *PGROUP_USERS_INFO_1, *LPGROUP_USERS_INFO_1;
*/
//Use: NetGroupGetUser( cServerName, cGlobalUsersName )
// cServerName -> DNS or NetBIOS name of the remote server on which the function is to execute.
// If this parameter is NIL, the local computer is used.
// cGlobalUsersName -> String that specifies the name of the global group whose members are to be listed.
HB_FUNC( NETGROUPGETUSERS )
{
LPCWSTR szServer = (LPCWSTR) hb_parc( 1 );
LPCWSTR szGroup = (LPCWSTR) hb_parc( 2 );
DWORD dwLevel = 0;
BYTE *pBuffer = NULL;
DWORD dwEntriesRead = 0, dwTotalEntries = 0;
NET_API_STATUS stat;
stat = NetGroupGetUsers( szServer,
szGroup,
dwLevel,
&pBuffer,
MAX_PREFERRED_LENGTH,
&dwEntriesRead,
&dwTotalEntries,
NULL );
DimeN( (LONG) stat );
DimeN( (LONG) dwEntriesRead );
DimeN( (LONG) dwTotalEntries );
hb_retc( "POR HACER" );
}
#pragma ENDDUMP