у меня windows 7. Добавила эти строчки #define WINVER 0x0500
#define _WIN32_WINNT 0x0500
Но увы они не помогли...
Компилятор какой? Если MinGW, то этой функции в хедерах нет. Определяйте самостоятельно. Вот вырезка из WtsApi32.h, котрый лежит в Win SDK 7.1:
/*=====================================================================
== WTS_PROCESS_INFO - returned by WTSEnumerateProcesses (version 1)
=====================================================================*/
/*
* WTSEnumerateProcesses() also returns data similar to
* WTSEnumerateServers(). It returns two variables: pProcessInfo and
* Count. The latter is the number of WTS_PROCESS_INFO structures
* contained in the former. Iteration is similar, except that there
* are four parts to each entry, so it would look like this:
*
* for ( i=0; i < Count; i++ ) {
* GetUserNameFromSid( pProcessInfo[i].pUserSid, UserName,
* sizeof(UserName) );
* _tprintf( TEXT("%-5u %-20s %-5u %s\n"),
* pProcessInfo[i].SessionId,
* UserName,
* pProcessInfo[i].ProcessId,
* pProcessInfo[i].pProcessName );
* }
*
* The memory returned is also segmented as the above, with all the
* structures allocated at the start and the string data at the end.
* We'll use S for the SessionId, R for the ProcessId, P for the
* pProcessName pointer and D for the string data, and U for pUserSid:
*
* S1 R1 P1 U1 S2 R2 P2 U2 S3 R3 P3 U3 ... Sn Rn Pn Un D1 D2 D3 ... Dn
*
* As above, this makes it easier to iterate the processes.
*/
typedef struct _WTS_PROCESS_INFOW {
DWORD SessionId; // session id
DWORD ProcessId; // process id
LPWSTR pProcessName; // name of process
PSID pUserSid; // user's SID
} WTS_PROCESS_INFOW, * PWTS_PROCESS_INFOW;
typedef struct _WTS_PROCESS_INFOA {
DWORD SessionId; // session id
DWORD ProcessId; // process id
LPSTR pProcessName; // name of process
PSID pUserSid; // user's SID
} WTS_PROCESS_INFOA, * PWTS_PROCESS_INFOA;
#ifdef UNICODE
#define WTS_PROCESS_INFO WTS_PROCESS_INFOW
#define PWTS_PROCESS_INFO PWTS_PROCESS_INFOW
#else
#define WTS_PROCESS_INFO WTS_PROCESS_INFOA
#define PWTS_PROCESS_INFO PWTS_PROCESS_INFOA
#endif
/*------------------------------------------------*/
BOOL
WINAPI
WTSEnumerateProcessesW(
IN HANDLE hServer,
IN DWORD Reserved,
IN DWORD Version,
OUT PWTS_PROCESS_INFOW * ppProcessInfo,
OUT DWORD * pCount
);
BOOL
WINAPI
WTSEnumerateProcessesA(
IN HANDLE hServer,
IN DWORD Reserved,
IN DWORD Version,
OUT PWTS_PROCESS_INFOA * ppProcessInfo,
OUT DWORD * pCount
);
#ifdef UNICODE
#define WTSEnumerateProcesses WTSEnumerateProcessesW
#else
#define WTSEnumerateProcesses WTSEnumerateProcessesA
#endif