Microsoft Information Protection (MIP) SDK for C: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C
Loading...
Searching...
No Matches
template_descriptor_cc.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27
28/**
29 * @brief Defines C-Style TemplateDescriptor functions
30 *
31 * @file template_descriptor_cc.h
32 */
33
34#ifndef API_MIP_PROTECTION_TEMPLATE_DESCRIPTOR_CC_H_
35#define API_MIP_PROTECTION_TEMPLATE_DESCRIPTOR_CC_H_
36
38#include "mip_cc/error_cc.h"
40#include "mip_cc/result_cc.h"
41
43
44/**
45 * @brief Gets template ID
46 *
47 * @param protectionDescriptor Descriptor associated with protected content
48 * @param templateId [Output] Template ID associated with protection
49 * @param errorInfo [Output] (Optional) Failure info if operation result is error
50 *
51 * @return Result code indicating success or failure
52 */
53MIP_CC_API(mip_cc_result) MIP_CC_TemplateDescriptor_GetId(
57
58/**
59 * @brief Gets size of buffer required to store name
60 *
61 * @param templateDescriptor Descriptor associated with template
62 * @param nameSize [Output] Size of buffer to hold name (in number of chars)
63 * @param errorInfo [Output] (Optional) Failure info if operation result is error
64 *
65 * @return Result code indicating success or failure
66 */
67MIP_CC_API(mip_cc_result) MIP_CC_TemplateDescriptor_GetNameSize(
68 const mip_cc_template_descriptor templateDescriptor,
69 int64_t* nameSize,
71
72/**
73 * @brief Gets Template name
74 *
75 * @param templateDescriptor Descriptor associated with template
76 * @param nameBuffer [Output] Buffer the name will be copied into.
77 * @param nameBufferSize Size (in number of chars) of the nameBuffer.
78 * @param actualNameSize [Output] Number of chars written to the buffer
79 * @param errorInfo [Output] (Optional) Failure info if operation result is error
80 *
81 * @return Result code indicating success or failure
82 *
83 * @note If NameBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
84 * actualNameSize will be set to the minimum required buffer size.
85 */
86MIP_CC_API(mip_cc_result) MIP_CC_TemplateDescriptor_GetName(
87 const mip_cc_template_descriptor templateDescriptor,
89 const int64_t nameBufferSize,
92
93/**
94 * @brief Gets size of buffer required to store description
95 *
96 * @param templateDescriptor Descriptor associated with template
97 * @param descriptionSize [Output] Size of buffer to hold description (in number of chars)
98 * @param errorInfo [Output] (Optional) Failure info if operation result is error
99 *
100 * @return Result code indicating success or failure
101 */
102MIP_CC_API(mip_cc_result) MIP_CC_TemplateDescriptor_GetDescriptionSize(
103 const mip_cc_template_descriptor templateDescriptor,
106
107/**
108 * @brief Gets Template description
109 *
110 * @param templateDescriptor Descriptor associated with template
111 * @param descriptionBuffer [Output] Buffer the description will be copied into.
112 * @param descriptionBufferSize Size (in number of chars) of the descriptionBuffer.
113 * @param actualNameSize [Output] Number of chars written to the buffer
114 * @param errorInfo [Output] (Optional) Failure info if operation result is error
115 *
116 * @return Result code indicating success or failure
117 *
118 * @note If descriptionBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
119 * actualDescriptionSize will be set to the minimum required buffer size.
120 */
121MIP_CC_API(mip_cc_result) MIP_CC_TemplateDescriptor_GetDescription(
122 const mip_cc_template_descriptor templateDescriptor,
123 char* nameBuffer,
124 const int64_t nameBufferSize,
125 int64_t* actualNameSize,
127
128/**
129 * @brief Release resources associated with a template descriptor
130 *
131 * @param templateDescriptor Template descriptor to be released
132 */
133MIP_CC_API(void) MIP_CC_ReleaseTemplateDescriptor(mip_cc_template_descriptor templateDescriptor);
134
135#endif // API_MIP_PROTECTION_TEMPLATE_DESCRIPTOR_CC_H_
A file Containing the common types used by the upe, file and protection modules.
Error definition and functions.
Export/import and other macros for C API.
mip_cc_protection_descriptor * protectionDescriptor
Defines success/error result codes.
mip_cc_result
API success/failure result.
Definition result_cc.h:44
Error information.
Definition error_cc.h:79
Opaque handle to MIP object.
int64_t * nameSize
char const int64_t int64_t * actualNameSize
char * nameBuffer
MIP_CC_API(void) MIP_CC_ReleaseTemplateDescriptor(mip_cc_template_descriptor templateDescriptor)
Release resources associated with a template descriptor.
int64_t * descriptionSize
mip_cc_guid mip_cc_error * errorInfo
char const int64_t nameBufferSize
mip_cc_handle * mip_cc_template_descriptor
mip_cc_guid * templateId