Commit 921e0457 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdsapi: Build with msvcrt.

parent 2cad63d7
...@@ -2,5 +2,7 @@ MODULE = ntdsapi.dll ...@@ -2,5 +2,7 @@ MODULE = ntdsapi.dll
IMPORTLIB = ntdsapi IMPORTLIB = ntdsapi
IMPORTS = user32 IMPORTS = user32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
ntdsapi.c ntdsapi.c
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "winuser.h" #include "winuser.h"
#include "ntdsapi.h" #include "ntdsapi.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntdsapi); WINE_DEFAULT_DEBUG_CHANNEL(ntdsapi);
...@@ -83,11 +82,11 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, ...@@ -83,11 +82,11 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name,
if (!svc_class || !svc_name) if (!svc_class || !svc_name)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
new_spn_length = strlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */; new_spn_length = lstrlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */;
if (inst_name) if (inst_name)
new_spn_length += strlenW(inst_name); new_spn_length += lstrlenW(inst_name);
else else
new_spn_length += strlenW(svc_name); new_spn_length += lstrlenW(svc_name);
if (inst_port) if (inst_port)
{ {
USHORT n = inst_port; USHORT n = inst_port;
...@@ -99,7 +98,7 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, ...@@ -99,7 +98,7 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name,
} while (n != 0); } while (n != 0);
} }
if (inst_name) if (inst_name)
new_spn_length += 1 /* for '/' */ + strlenW(svc_name); new_spn_length += 1 /* for '/' */ + lstrlenW(svc_name);
if (*spn_length < new_spn_length) if (*spn_length < new_spn_length)
{ {
...@@ -109,21 +108,21 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, ...@@ -109,21 +108,21 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name,
*spn_length = new_spn_length; *spn_length = new_spn_length;
p = spn; p = spn;
len = strlenW(svc_class); len = lstrlenW(svc_class);
memcpy(p, svc_class, len * sizeof(WCHAR)); memcpy(p, svc_class, len * sizeof(WCHAR));
p += len; p += len;
*p = '/'; *p = '/';
p++; p++;
if (inst_name) if (inst_name)
{ {
len = strlenW(inst_name); len = lstrlenW(inst_name);
memcpy(p, inst_name, len * sizeof(WCHAR)); memcpy(p, inst_name, len * sizeof(WCHAR));
p += len; p += len;
*p = '\0'; *p = '\0';
} }
else else
{ {
len = strlenW(svc_name); len = lstrlenW(svc_name);
memcpy(p, svc_name, len * sizeof(WCHAR)); memcpy(p, svc_name, len * sizeof(WCHAR));
p += len; p += len;
*p = '\0'; *p = '\0';
...@@ -135,14 +134,14 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, ...@@ -135,14 +134,14 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name,
*p = ':'; *p = ':';
p++; p++;
wsprintfW(p, percentU, inst_port); wsprintfW(p, percentU, inst_port);
p += strlenW(p); p += lstrlenW(p);
} }
if (inst_name) if (inst_name)
{ {
*p = '/'; *p = '/';
p++; p++;
len = strlenW(svc_name); len = lstrlenW(svc_name);
memcpy(p, svc_name, len * sizeof(WCHAR)); memcpy(p, svc_name, len * sizeof(WCHAR));
p += len; p += len;
*p = '\0'; *p = '\0';
...@@ -216,7 +215,7 @@ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD ...@@ -216,7 +215,7 @@ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD
if (!class || !name || !buflen) return ERROR_INVALID_PARAMETER; if (!class || !name || !buflen) return ERROR_INVALID_PARAMETER;
len = strlenW(class) + 1 + strlenW(name) + 1; len = lstrlenW(class) + 1 + lstrlenW(name) + 1;
if (*buflen < len) if (*buflen < len)
{ {
*buflen = len; *buflen = len;
...@@ -224,10 +223,10 @@ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD ...@@ -224,10 +223,10 @@ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD
} }
*buflen = len; *buflen = len;
memcpy(buf, class, strlenW(class) * sizeof(WCHAR)); memcpy(buf, class, lstrlenW(class) * sizeof(WCHAR));
p = buf + strlenW(class); p = buf + lstrlenW(class);
*p++ = '/'; *p++ = '/';
memcpy(p, name, strlenW(name) * sizeof(WCHAR)); memcpy(p, name, lstrlenW(name) * sizeof(WCHAR));
buf[len - 1] = 0; buf[len - 1] = 0;
return ERROR_SUCCESS; return ERROR_SUCCESS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment