Go to the source code of this file.
◆ CharToByte()
Definition at line 226 of file misc.c.
228{
230 {
232 }
234 {
236 return (
INT)Char - ((
INT)
'A' - 10);
237 else
238 return (
INT)Char - ((
INT)
'a' - 10);
239 }
240 return 0;
241}
Referenced by StringToGUID().
◆ CreateGUID()
Definition at line 170 of file misc.c.
172{
174
175 pGuid->Data3 &= 0x0fff;
176 pGuid->Data3 |= (4 << 12);
177
178
179
180 pGuid->Data4[0] &= 0x3f;
181 pGuid->Data4[0] |= 0x80;
182}
Referenced by ConvertGPT(), and InsertGptPartition().
◆ CreateSignature()
◆ DuplicateQuotedString()
Definition at line 102 of file misc.c.
104{
108
111
112 if (pszInString[0] ==
L'"')
113 {
116
117 pStart = &pszInString[1];
118 pEnd =
wcschr(pStart,
'"');
120 {
122 }
123 else
124 {
126 }
127 }
128 else
129 {
130 pStart = pszInString;
132 }
133
137 if (pszOutString ==
NULL)
139
141
142 return pszOutString;
143}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
WINBASEAPI _In_ DWORD nLength
◆ DuplicateString()
Definition at line 147 of file misc.c.
149{
152
155
160 if (pszOutString ==
NULL)
162
163 wcscpy(pszOutString, pszInString);
164
165 return pszOutString;
166}
◆ HasPrefix()
Definition at line 76 of file misc.c.
80{
82
83 nPrefixLength =
wcslen(pszPrefix);
85 if ((
ret == 0) && (ppszSuffix !=
NULL))
86 *ppszSuffix = &pszString[nPrefixLength];
87
89}
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
Referenced by AcpiExGetNameString(), assign_main(), CreateEfiPartition(), CreateExtendedPartition(), CreateLogicalPartition(), CreateMsrPartition(), CreatePrimaryPartition(), format_main(), gpt_main(), remove_main(), setid_main(), and UniqueIdDisk().
◆ IsDecString()
◆ IsDriveLetter()
◆ IsHexString()
◆ PrintBusType()
Definition at line 313 of file misc.c.
317{
321 pszBuffer,
322 cchBufferMax);
323 else
326 pszBuffer,
327 cchBufferMax);
328}
#define IDS_BUSTYPE_OTHER
#define IDS_BUSTYPE_UNKNOWN
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Referenced by DetailDisk().
◆ PrintGUID()
Definition at line 205 of file misc.c.
208{
210 L"%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
211 pGuid->Data1,
212 pGuid->Data2,
213 pGuid->Data3,
214 pGuid->Data4[0],
215 pGuid->Data4[1],
216 pGuid->Data4[2],
217 pGuid->Data4[3],
218 pGuid->Data4[4],
219 pGuid->Data4[5],
220 pGuid->Data4[6],
221 pGuid->Data4[7]);
222}
#define _swprintf(buf, format,...)
Referenced by DetailDisk(), DetailPartition(), and UniqueIdDisk().
◆ RoundingDivide()
Definition at line 93 of file misc.c.
96{
98}
_In_ LARGE_INTEGER Divisor
◆ StringToGUID()
Definition at line 245 of file misc.c.
248{
250
251 if (pszString ==
NULL)
253
254 pGuid->Data1 = 0;
255 for (
i = 0;
i < 8;
i++)
256 {
259
260 pGuid->Data1 = (pGuid->Data1 << 4) |
CharToByte(pszString[
i]);
261 }
262
263 if (pszString[8] !=
L'-')
265
266 pGuid->Data2 = 0;
267 for (
i = 9;
i < 13;
i++)
268 {
271
272 pGuid->Data2 = (pGuid->Data2 << 4) |
CharToByte(pszString[
i]);
273 }
274
275 if (pszString[13] !=
L'-')
277
278 pGuid->Data3 = 0;
279 for (
i = 14;
i < 18;
i++)
280 {
283
284 pGuid->Data3 = (pGuid->Data3 << 4) |
CharToByte(pszString[
i]);
285 }
286
287 if (pszString[18] !=
L'-')
289
290 for (
i = 19;
i < 36;
i += 2)
291 {
293 {
294 if (pszString[
i] !=
L'-')
297 }
298
301
303 }
304
305 if (pszString[36] ==
L'\0')
307
309}
static BYTE CharToByte(WCHAR Char)
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
Referenced by CreatePrimaryGptPartition(), setid_main(), and UniqueIdDisk().