少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
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
68
69
70
71
72
73
/**
 * \file
 * Security Manager
 *
 * Author:
 *    Sebastien Pouliot  <sebastien@ximian.com>
 *
 * Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
 
#ifndef _MONO_METADATA_SECURITY_MANAGER_H_
#define _MONO_METADATA_SECURITY_MANAGER_H_
 
#include <string.h>
 
#include "object.h"
#include "metadata-internals.h"
#include "domain-internals.h"
#include "tokentype.h"
#include "threads.h"
#include "marshal.h"
#include "image.h"
#include "reflection.h"
#include "tabledefs.h"
 
 
/* Definitions */
 
#define MONO_ECMA_KEY_LENGTH            16
#define MONO_PUBLIC_KEY_HEADER_LENGTH        32
#define MONO_MINIMUM_PUBLIC_KEY_LENGTH        48
#define MONO_DEFAULT_PUBLIC_KEY_LENGTH        128
 
#define MONO_PUBLIC_KEY_BIT_SIZE(x)        ((x - MONO_PUBLIC_KEY_HEADER_LENGTH) << 3)
 
enum {
    MONO_METADATA_SECURITY_OK        = 0x00,
    MONO_METADATA_INHERITANCEDEMAND_CLASS    = 0x01,
    MONO_METADATA_INHERITANCEDEMAND_METHOD    = 0x02
};
 
typedef enum {
    MONO_SECURITY_MODE_NONE,
    MONO_SECURITY_MODE_CORE_CLR,
} MonoSecurityMode;
 
/* Structures */
 
typedef struct {
    MonoClass *securitymanager;        /* System.Security.SecurityManager */
} MonoSecurityManager;
 
gboolean mono_is_ecma_key (const char *publickey, int size);
MonoMethod* mono_get_context_capture_method (void);
 
MonoSecurityManager* mono_security_manager_get_methods (void);
 
/* Security mode */
UNITY_MONO_API void mono_security_set_mode (MonoSecurityMode mode);
MonoSecurityMode mono_security_get_mode (void);
 
/* internal calls */
MonoBoolean ves_icall_System_Security_SecurityManager_get_SecurityEnabled (void);
void ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value);
 
#ifndef DISABLE_SECURITY
#define mono_security_core_clr_enabled() (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR)
#else
#define mono_security_core_clr_enabled() (FALSE)
#endif
 
#endif /* _MONO_METADATA_SECURITY_MANAGER_H_ */