tasklist.h 2.02 KB
Newer Older
1
/*
2
 * Copyright 2023 Zhiyi Zhang for CodeWeavers
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

19
#include <windef.h>
20

21 22 23 24 25 26 27 28 29
#define MAXSTRING 8192

#define STRING_USAGE                    101
#define STRING_IMAGE_NAME               102
#define STRING_PID                      103
#define STRING_SESSION_NAME             104
#define STRING_SESSION_NUMBER           105
#define STRING_MEM_USAGE                106
#define STRING_K                        107
30
#define STRING_INVALID_SYNTAX           108
31
#define STRING_FILTER_NOT_RECOGNIZED    109
32 33 34 35 36 37 38

enum tasklist_format
{
    TABLE = 0,
    CSV   = 1,
    LIST  = 2,
};
39

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
enum tasklist_filter_name
{
    IMAGENAME   = 1,
    PID         = 2,
    SESSION     = 3,
    SESSIONNAME = 4,
    MEMUSAGE    = 5,
};

enum tasklist_filter_operator
{
    EQ = 0,
    NE = 1,
    GT = 2,
    LT = 3,
    GE = 4,
    LE = 5,
};

struct tasklist_filter
{
    enum tasklist_filter_name name;
    enum tasklist_filter_operator op;
    WCHAR *value;
    struct tasklist_filter *next;
};

67 68
struct tasklist_process_info
{
69 70 71
    DWORD pid_value;
    DWORD memory_usage_value;
    DWORD session_id_value;
72 73 74 75 76 77
    WCHAR image_name[32];
    WCHAR pid[32];
    WCHAR session_name[32];
    WCHAR session_number[32];
    WCHAR memory_usage[32];
};
78 79 80 81

struct tasklist_options
{
    BOOL no_header;
82
    enum tasklist_format format;
83
    struct tasklist_filter *filters;
84
};