ReactOS  0.4.15-dev-1206-g731eddf
connect.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for connect.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS WINAPI SmConnectApiPort (IN PUNICODE_STRING pSbApiPortName OPTIONAL, IN HANDLE hSbApiPort OPTIONAL, IN WORD wSubSystemId OPTIONAL, IN OUT PHANDLE phSmApiPort)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file connect.c.

Function Documentation

◆ SmConnectApiPort()

NTSTATUS WINAPI SmConnectApiPort ( IN PUNICODE_STRING pSbApiPortName  OPTIONAL,
IN HANDLE hSbApiPort  OPTIONAL,
IN WORD wSubSystemId  OPTIONAL,
IN OUT PHANDLE  phSmApiPort 
)

Definition at line 43 of file connect.c.

47 {
48  UNICODE_STRING SmApiPortName;
49  SECURITY_QUALITY_OF_SERVICE SecurityQos;
51  SM_CONNECT_DATA ConnectData = {0,0,{0}};
52  ULONG ConnectDataLength = 0;
53 
54  DPRINT("SMLIB: %s called\n", __FUNCTION__);
55 
56  if (pSbApiPortName)
57  {
58  if (pSbApiPortName->Length > (sizeof pSbApiPortName->Buffer[0] * SM_SB_NAME_MAX_LENGTH))
59  {
61  }
62  if (NULL == hSbApiPort || IMAGE_SUBSYSTEM_UNKNOWN == wSubSystemId)
63  {
65  }
66  RtlZeroMemory (& ConnectData, sizeof ConnectData);
67  ConnectData.Unused = 0;
68  ConnectData.SubSystemId = wSubSystemId;
69  if (pSbApiPortName->Length > 0)
70  {
71  RtlCopyMemory (& ConnectData.SbName,
72  pSbApiPortName->Buffer,
73  pSbApiPortName->Length);
74  }
75  }
76  ConnectDataLength = sizeof ConnectData;
77 
78  SecurityQos.Length = sizeof (SecurityQos);
81  SecurityQos.EffectiveOnly = TRUE;
82 
83  RtlInitUnicodeString (& SmApiPortName, SM_API_PORT_NAME);
84 
86  phSmApiPort,
87  & SmApiPortName,
88  & SecurityQos,
89  NULL,
90  NULL,
91  NULL,
92  & ConnectData,
93  & ConnectDataLength
94  );
95  if (NT_SUCCESS(Status))
96  {
97  return STATUS_SUCCESS;
98  }
99  DPRINT("SMLIB: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status);
100  return Status;
101 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define SM_SB_NAME_MAX_LENGTH
Definition: api.h:8
#define STATUS_INVALID_PARAMETER_MIX
Definition: ntstatus.h:285
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
Definition: lsa.idl:66
WCHAR SbName[SM_SB_NAME_MAX_LENGTH]
Definition: api.h:17
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
USHORT SubSystemId
Definition: api.h:15
WORD Unused
Definition: api.h:16
NTSTATUS NTAPI NtConnectPort(OUT PHANDLE PortHandle, IN PUNICODE_STRING PortName, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos, IN OUT PPORT_VIEW ClientView OPTIONAL, IN OUT PREMOTE_PORT_VIEW ServerView OPTIONAL, OUT PULONG MaxMessageLength OPTIONAL, IN OUT PVOID ConnectionInformation OPTIONAL, IN OUT PULONG ConnectionInformationLength OPTIONAL)
Definition: connect.c:753
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SM_API_PORT_NAME
Definition: ns.h:7
#define IMAGE_SUBSYSTEM_UNKNOWN
Definition: ntimage.h:435
#define SECURITY_DYNAMIC_TRACKING
Definition: setypes.h:103
Status
Definition: gdiplustypes.h:24
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:475
HANDLE hSbApiPort
Definition: init.c:32
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: lsa.idl:65
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define __FUNCTION__
Definition: types.h:112