Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
986de4b1
Commit
986de4b1
authored
Mar 12, 1999
by
Stephane Lussier
Committed by
Alexandre Julliard
Mar 12, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented DosDateTimeToVariant() and SysAllocStringByteLen() functions.
parent
6d40d1b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
2 deletions
+79
-2
ole2disp.c
ole/ole2disp.c
+52
-0
variant.c
ole/variant.c
+25
-0
oleaut32.spec
relay32/oleaut32.spec
+2
-2
No files found.
ole/ole2disp.c
View file @
986de4b1
...
...
@@ -326,6 +326,58 @@ INT WINAPI OleTranslateColor(
return
S_OK
;
}
/******************************************************************************
* SysAllocStringByteLen [OLEAUT32.150]
*
*/
BSTR
WINAPI
SysAllocStringByteLen
(
char
*
in
,
int
len
)
{
DWORD
*
newBuffer
;
char
*
stringBuffer
;
/*
* Allocate a new buffer to hold the string.
* dont't forget to keep an empty spot at the begining of the
* buffer for the character count and an extra character at the
* end for the NULL.
*/
newBuffer
=
(
DWORD
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
len
+
sizeof
(
WCHAR
)
+
sizeof
(
DWORD
));
/*
* If the memory allocation failed, return a null pointer.
*/
if
(
newBuffer
==
0
)
return
0
;
/*
* Copy the length of the string in the placeholder.
*/
*
newBuffer
=
len
;
/*
* Skip the byte count.
*/
newBuffer
++
;
/*
* Copy the information in the buffer.
* Since it is valid to pass a NULL pointer here, we'll initialize the
* buffer to nul if it is the case.
*/
if
(
in
!=
0
)
memcpy
(
newBuffer
,
in
,
len
);
/*
* Make sure that there is a nul character at the end of the
* string.
*/
stringBuffer
=
(
char
*
)
newBuffer
;
stringBuffer
[
len
]
=
0
;
stringBuffer
[
len
+
1
]
=
0
;
return
(
LPWSTR
)
stringBuffer
;
}
ole/variant.c
View file @
986de4b1
...
...
@@ -4237,3 +4237,28 @@ HRESULT WINAPI VarCyFromUI4(ULONG ulIn, CY* pcyOut) {
return
S_OK
;
}
/**********************************************************************
* DosDateTimeToVariantTime [OLEAUT32.14]
* Convert dos representation of time to the date and time representation
* stored in a variant.
*/
INT
WINAPI
DosDateTimeToVariantTime
(
USHORT
wDosDate
,
USHORT
wDosTime
,
DATE
*
pvtime
)
{
struct
tm
t
;
TRACE
(
ole
,
"( 0x%x, 0x%x, 0x%p ), stub
\n
"
,
wDosDate
,
wDosTime
,
pvtime
);
t
.
tm_sec
=
(
wDosTime
&
0x001f
)
*
2
;
t
.
tm_min
=
(
wDosTime
&
0x07e0
)
>>
5
;
t
.
tm_hour
=
(
wDosTime
&
0xf800
)
>>
11
;
t
.
tm_mday
=
(
wDosDate
&
0x001f
);
t
.
tm_mon
=
(
wDosDate
&
0x01e0
)
>>
5
;
t
.
tm_year
=
((
wDosDate
&
0xfe00
)
>>
9
)
+
1980
;
return
TmToDATE
(
&
t
,
pvtime
);
}
relay32/oleaut32.spec
View file @
986de4b1
...
...
@@ -14,7 +14,7 @@ type win32
11 stdcall VariantCopyInd(ptr ptr) VariantCopyInd
12 stdcall VariantChangeType(ptr ptr) VariantChangeType
13 stub VariantTimeToDosDateTime
14 st
ub
DosDateTimeToVariantTime
14 st
dcall DosDateTimeToVariantTime(long ptr)
DosDateTimeToVariantTime
15 stdcall SafeArrayCreate(long long ptr) SafeArrayCreate
16 stdcall SafeArrayDestroy(ptr) SafeArrayDestroy
17 stdcall SafeArrayGetDim(ptr) SafeArrayGetDim
...
...
@@ -129,7 +129,7 @@ type win32
147 stdcall VariantChangeTypeEx(ptr ptr) VariantChangeTypeEx
148 stub SafeArrayPtrOfIndex
149 stdcall SysStringByteLen(ptr) SysStringByteLen
150 st
ub
SysAllocStringByteLen
150 st
dcall SysAllocStringByteLen(ptr long)
SysAllocStringByteLen
160 stub CreateTypeLib
161 stdcall LoadTypeLib (ptr ptr) LoadTypeLib
162 stdcall LoadRegTypeLib (ptr long long long ptr) LoadRegTypeLib
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment