Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
986de4b1
Commit
986de4b1
authored
26 years ago
by
Stephane Lussier
Committed by
Alexandre Julliard
26 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implemented DosDateTimeToVariant() and SysAllocStringByteLen() functions.
parent
6d40d1b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ole/ole2disp.c
+52
-0
52 additions, 0 deletions
ole/ole2disp.c
ole/variant.c
+25
-0
25 additions, 0 deletions
ole/variant.c
relay32/oleaut32.spec
+2
-2
2 additions, 2 deletions
relay32/oleaut32.spec
with
79 additions
and
2 deletions
ole/ole2disp.c
+
52
−
0
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
;
}
This diff is collapsed.
Click to expand it.
ole/variant.c
+
25
−
0
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
);
}
This diff is collapsed.
Click to expand it.
relay32/oleaut32.spec
+
2
−
2
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment