-
Notifications
You must be signed in to change notification settings - Fork 3
/
pathproc.h
67 lines (50 loc) · 1.99 KB
/
pathproc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
67
/*
* Copyright (c) 2004 Security Architects Corporation. All rights reserved.
*
* Module Name:
*
* pathproc.h
*
* Abstract:
*
* This module definies various types used by pathname handling routines.
*
* Author:
*
* Eugene Tsyrklevich 19-Feb-2004
*
* Revision History:
*
* None.
*/
#ifndef __PATHPROC_H__
#define __PATHPROC_H__
#include <NTDDK.h>
#include "log.h"
// some registry keys are actually longer than 260 chars!
// HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses\{6994AD04-93EF-11D0-A3CC-00A0C9223196}\##?#Root#SYSTEM#0000#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\#{2f412ab5-ed3a-4590-ab24-b0ce2aa77d3c}&{9B365890-165F-11D0-A195-0020AFD156E4}\Device Parameters
//#define MAX_PATH 260
#define MAX_PATH 300
#define chMAX_PATH MAX_PATH
#define bMAX_PATH (MAX_PATH * sizeof(WCHAR))
/* maximum number of links to follow */
#define MAX_NUMBER_OF_LINKS 3
#define DO_NOT_RESOLVE_LINKS 0
#define RESOLVE_LINKS 1
BOOLEAN GetPathFromOA(IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PCHAR OutBuffer, IN USHORT OutBufferSize, IN BOOLEAN ResolveLinks);
BOOLEAN GetPathFromOAW(IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PCHAR OutBuffer, IN USHORT OutBufferSize, IN BOOLEAN ResolveLinks);
BOOLEAN ResolveFilename(IN PCHAR szFileName, OUT PCHAR szResult, IN USHORT szResultSize);
BOOLEAN ResolveFilenameW(IN PUNICODE_STRING szFileName, OUT PCHAR szResult, IN USHORT szResultSize);
PWSTR GetNameFromHandle(IN HANDLE ObjectHandle, OUT PWSTR OutBuffer, IN USHORT OutBufferSize);
BOOLEAN FixupFilename(IN PCHAR szFileName, OUT PCHAR szResult, IN USHORT szResultSize);
BOOLEAN VerifyExecutableName(IN PCHAR szFileName);
PCHAR StripFileMacros(IN PCHAR Path, OUT PCHAR Buffer, IN USHORT BufferSize);
BOOLEAN ConvertLongFileNameToShort(IN PCHAR LongFileName, OUT PCHAR ShortFileName, IN USHORT ShortFileNameSize);
NTSTATUS
ObQueryNameString(
IN PVOID Object,
OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
IN ULONG Length,
OUT PULONG ReturnLength
);
#endif /* __PATHPROC_H__ */