Process Hacker
basesupa.c
Go to the documentation of this file.
1 /*
2  * Process Hacker -
3  * base support functions (auto-dereference enabled)
4  *
5  * Copyright (C) 2010 wj32
6  *
7  * This file is part of Process Hacker.
8  *
9  * Process Hacker is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * Process Hacker is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #include <phbase.h>
24 
26  _In_ PWSTR Buffer
27  )
28 {
30 }
31 
33  _In_opt_ PWSTR Buffer,
34  _In_ SIZE_T Length
35  )
36 {
37  return PhAutoDereferenceObject(PhCreateStringEx(Buffer, Length));
38 }
39 
41  _In_ PPH_STRING String
42  )
43 {
45 }
46 
48  _In_ ULONG Count,
49  ...
50  )
51 {
52  va_list argptr;
53 
54  va_start(argptr, Count);
55 
56  return PhAutoDereferenceObject(PhConcatStrings_V(Count, argptr));
57 }
58 
60  _In_ PWSTR String1,
61  _In_ PWSTR String2
62  )
63 {
64  return PhAutoDereferenceObject(PhConcatStrings2(String1, String2));
65 }
66 
68  _In_ _Printf_format_string_ PWSTR Format,
69  ...
70  )
71 {
72  va_list argptr;
73 
74  va_start(argptr, Format);
75 
76  return PhAutoDereferenceObject(PhFormatString_V(Format, argptr));
77 }
78 
80  _In_ PPH_STRING String
81  )
82 {
83  PPH_STRING newString;
84 
85  newString = PhaDuplicateString(String);
86  PhLowerString(newString);
87 
88  return newString;
89 }
90 
92  _In_ PPH_STRING String
93  )
94 {
95  PPH_STRING newString;
96 
97  newString = PhaDuplicateString(String);
98  PhUpperString(newString);
99 
100  return newString;
101 }
102 
104  _In_ PPH_STRING String,
105  _In_ SIZE_T StartIndex,
106  _In_ SIZE_T Count
107  )
108 {
109  return PhAutoDereferenceObject(PhSubstring(String, StartIndex, Count));
110 }