Go to the source code of this file.
◆ cmdSession()
Definition at line 91 of file cmdSession.c.
94{
101
103 {
105 {
106 pszComputerName =
argv[
i];
108 }
110 {
112 continue;
113 }
115 {
117 continue;
118 }
120 {
125 return 0;
126 }
127 else
128 {
132 return 1;
133 }
134 }
135
136 if (bDelete)
138 else
140
142 {
144 }
145 else
146 {
149 }
150
152}
static VOID PrintErrorMessage(DWORD dwError)
void ConPuts(FILE *fp, LPCWSTR psz)
VOID PrintNetMessage(DWORD dwMessage)
VOID PrintMessageString(DWORD dwMessage)
NET_API_STATUS EnumSessions(_In_ PWSTR pszComputerName, _In_ BOOL bList)
NET_API_STATUS WINAPI NetSessionDel(_In_opt_ LMSTR servername, _In_opt_ LMSTR UncClientName, _In_opt_ LMSTR username)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
◆ EnumSessions()
Definition at line 29 of file cmdSession.c.
32{
34 WCHAR DurationBuffer[10];
35 DWORD dwRead = 0, dwTotal = 0,
i;
36 DWORD ResumeHandle = 0;
38
42 2,
45 &dwRead,
46 &dwTotal,
47 &ResumeHandle);
49 {
50
53 }
54
55 if (dwTotal == 0)
56 {
58 }
59 else
60 {
65
66 for (
i = 0;
i < dwRead;
i++)
67 {
69 {
73
79 DurationBuffer);
80 }
81 }
82 }
83
85
87}
void ConPrintf(FILE *fp, LPCWSTR psz,...)
VOID PrintPadding(WCHAR chr, INT nPaddedLength)
static VOID SecondsToDurationString(_Out_ PWSTR DurationString, _In_ size_t DurationStringSize, _In_ DWORD dwDuration)
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
NET_API_STATUS WINAPI NetSessionEnum(_In_opt_ LMSTR servername, _In_opt_ LMSTR UncClientName, _In_opt_ LMSTR username, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle)
#define MAX_PREFERRED_LENGTH
Referenced by cmdSession(), and DECLARE_INTERFACE_().
◆ SecondsToDurationString()
Definition at line 12 of file cmdSession.c.
16{
17 DWORD dwHours, dwRemainingSeconds, dwMinutes, dwSeconds;
18
19 dwHours = dwDuration / 3600;
20 dwRemainingSeconds = dwDuration % 3600;
21 dwMinutes = dwRemainingSeconds / 60;
22 dwSeconds = dwRemainingSeconds % 60;
23
24 StringCchPrintfW(DurationString, DurationStringSize,
L"%02lu:%02lu:%02lu", dwHours, dwMinutes, dwSeconds);
25}
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Referenced by EnumSessions().