ReactOS  0.4.15-dev-3303-g1ade494
fxstringapi.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxStringApi.cpp
8 
9 Abstract:
10 
11  This module implements the "C" interface to the collection object.
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  Both kernel and user mode
20 
21 Revision History:
22 
23 --*/
24 
25 #include "fxsupportpch.hpp"
26 
27 extern "C" {
28 // #include "FxStringAPI.tmh"
29 }
30 
31 extern "C" {
32 
36 STDCALL
37 WDFEXPORT(WdfStringCreate)(
38  __in
40  __in_opt
42  __in_opt
44  __out
45  WDFSTRING* String
46  )
47 {
48  DDI_ENTRY();
49 
53 
55 
56  //
57  // Get the parent's globals if it is present
58  //
60  StringAttributes))) {
62 
64  StringAttributes->ParentObject,
66  (PVOID*)&pParent,
68  }
69 
71 
72  *String = NULL;
73 
75  if (!NT_SUCCESS(status)) {
76  return status;
77  }
78 
80  if (!NT_SUCCESS(status)) {
81  return status;
82  }
83 
84  if (UnicodeString != NULL) {
86  if (!NT_SUCCESS(status)) {
87  return status;
88  }
89  }
90 
92 
93  if (pString != NULL) {
94  if (UnicodeString != NULL) {
96  }
97 
98  if (NT_SUCCESS(status)) {
100  }
101 
102  if (!NT_SUCCESS(status)) {
104  pString = NULL;
105  }
106  }
107  else {
109 
112  "Could not allocate WDFSTRING handle, %!STATUS!", status);
113  }
114 
115  return status;
116 }
117 
119 VOID
120 STDCALL
121 WDFEXPORT(WdfStringGetUnicodeString)(
122  __in
124  __in
125  WDFSTRING String,
126  __out
128  )
129 {
130  DDI_ENTRY();
131 
133  FxString* pString;
135 
137  String,
139  (PVOID*) &pString,
141 
143 
145  if (!NT_SUCCESS(status)) {
146  return;
147  }
148 
151  sizeof(UNICODE_STRING));
152 }
153 
154 } // extern "C"
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
Definition: fxobject.cpp:904
#define __in_opt
Definition: dbghelp.h:38
LONG NTSTATUS
Definition: precomp.h:26
DriverGlobals
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: fxstringapi.cpp:50
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
_Must_inspect_result_ __in_opt PCUNICODE_STRING UnicodeString
Definition: fxstringapi.cpp:41
_Must_inspect_result_ NTSTATUS __inline FxValidateObjectAttributesForParentHandle(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
#define __out
Definition: dbghelp.h:62
NTSTATUS status
Definition: fxstringapi.cpp:52
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
#define STDCALL
Definition: wdf.h:45
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ NTSTATUS Assign(__in PCWSTR SourceString)
Definition: fxstring.cpp:57
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
_Must_inspect_result_ NTSTATUS __inline FxValidateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING String)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
_Must_inspect_result_ __in_opt PCUNICODE_STRING __in_opt PWDF_OBJECT_ATTRIBUTES StringAttributes
Definition: fxstringapi.cpp:41
FxString * pString
Definition: fxstringapi.cpp:51
FxPointerNotNull(pFxDriverGlobals, String)
#define NULL
Definition: types.h:112
struct _UNICODE_STRING UNICODE_STRING
_Must_inspect_result_ __drv_maxIRQL(PASSIVE_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfStringCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
FxObject * pParent
Definition: fxdpcapi.cpp:86
RtlCopyMemory(UnicodeString, pString->GetUnicodeString(), sizeof(UNICODE_STRING))
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGERROR, "Could not allocate WDFSTRING handle, %!STATUS!", status)
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
PUNICODE_STRING __inline GetUnicodeString(VOID)
Definition: fxstring.hpp:64
_Must_inspect_result_ __in_opt PCUNICODE_STRING __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFSTRING * String
Definition: fxstringapi.cpp:47
#define TRACINGERROR
Definition: dbgtrace.h:63
#define __in
Definition: dbghelp.h:35
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), String, FX_TYPE_STRING,(PVOID *) &pString, &pFxDriverGlobals)
Definition: ps.c:97