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
0f0b6c8c
Commit
0f0b6c8c
authored
Dec 27, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Dec 27, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement thread safety for records.
parent
5d7d188d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
handle.c
dlls/msi/handle.c
+20
-0
msipriv.h
dlls/msi/msipriv.h
+2
-0
record.c
dlls/msi/record.c
+20
-0
No files found.
dlls/msi/handle.c
View file @
0f0b6c8c
...
...
@@ -41,6 +41,16 @@ static CRITICAL_SECTION_DEBUG MSI_handle_cs_debug =
};
static
CRITICAL_SECTION
MSI_handle_cs
=
{
&
MSI_handle_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
CRITICAL_SECTION
MSI_object_cs
;
static
CRITICAL_SECTION_DEBUG
MSI_object_cs_debug
=
{
0
,
0
,
&
MSI_object_cs
,
{
&
MSI_object_cs_debug
.
ProcessLocksList
,
&
MSI_object_cs_debug
.
ProcessLocksList
},
0
,
0
,
{
0
,
(
DWORD
)(
__FILE__
": MSI_object_cs"
)
}
};
static
CRITICAL_SECTION
MSI_object_cs
=
{
&
MSI_object_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
MSIOBJECTHDR
*
msihandletable
[
MSIMAXHANDLES
];
MSIHANDLE
alloc_msihandle
(
MSIOBJECTHDR
*
obj
)
...
...
@@ -143,6 +153,16 @@ void msiobj_addref( MSIOBJECTHDR *info )
info
->
refcount
++
;
}
void
msiobj_lock
(
MSIOBJECTHDR
*
info
)
{
EnterCriticalSection
(
&
MSI_object_cs
);
}
void
msiobj_unlock
(
MSIOBJECTHDR
*
info
)
{
LeaveCriticalSection
(
&
MSI_object_cs
);
}
int
msiobj_release
(
MSIOBJECTHDR
*
info
)
{
int
ret
;
...
...
dlls/msi/msipriv.h
View file @
0f0b6c8c
...
...
@@ -230,6 +230,8 @@ extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * );
extern
void
*
alloc_msiobject
(
UINT
type
,
UINT
size
,
msihandledestructor
destroy
);
extern
void
msiobj_addref
(
MSIOBJECTHDR
*
);
extern
int
msiobj_release
(
MSIOBJECTHDR
*
);
extern
void
msiobj_lock
(
MSIOBJECTHDR
*
);
extern
void
msiobj_unlock
(
MSIOBJECTHDR
*
);
extern
MSIHANDLE
msiobj_findhandle
(
MSIOBJECTHDR
*
hdr
);
/* add this table to the list of cached tables in the database */
...
...
dlls/msi/record.c
View file @
0f0b6c8c
...
...
@@ -116,7 +116,9 @@ unsigned int WINAPI MsiRecordGetFieldCount( MSIHANDLE handle )
return
0
;
}
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordGetFieldCount
(
rec
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
...
...
@@ -180,7 +182,9 @@ int WINAPI MsiRecordGetInteger( MSIHANDLE handle, unsigned int iField)
if
(
!
rec
)
return
MSI_NULL_INTEGER
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordGetInteger
(
rec
,
iField
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
...
...
@@ -197,12 +201,14 @@ UINT WINAPI MsiRecordClearData( MSIHANDLE handle )
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
for
(
i
=
0
;
i
<=
rec
->
count
;
i
++
)
{
MSI_FreeField
(
&
rec
->
fields
[
i
]
);
rec
->
fields
[
i
].
type
=
MSIFIELD_NULL
;
rec
->
fields
[
i
].
u
.
iVal
=
0
;
}
msiobj_unlock
(
&
rec
->
hdr
);
return
ERROR_SUCCESS
;
}
...
...
@@ -232,7 +238,9 @@ UINT WINAPI MsiRecordSetInteger( MSIHANDLE handle, unsigned int iField, int iVal
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordSetInteger
(
rec
,
iField
,
iVal
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
}
...
...
@@ -259,7 +267,9 @@ BOOL WINAPI MsiRecordIsNull( MSIHANDLE handle, unsigned int iField )
rec
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_RECORD
);
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordIsNull
(
rec
,
iField
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
...
...
@@ -318,7 +328,9 @@ UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, unsigned int iField,
rec
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_RECORD
);
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordGetStringA
(
rec
,
iField
,
szValue
,
pcchValue
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
}
...
...
@@ -385,7 +397,9 @@ UINT WINAPI MsiRecordGetStringW(MSIHANDLE handle, unsigned int iField,
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordGetStringW
(
rec
,
iField
,
szValue
,
pcchValue
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
}
...
...
@@ -426,7 +440,9 @@ UINT WINAPI MsiRecordSetStringA( MSIHANDLE handle, unsigned int iField, LPCSTR s
rec
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_RECORD
);
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordSetStringA
(
rec
,
iField
,
szValue
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
}
...
...
@@ -463,7 +479,9 @@ UINT WINAPI MsiRecordSetStringW( MSIHANDLE handle, unsigned int iField, LPCWSTR
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordSetStringW
(
rec
,
iField
,
szValue
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
}
...
...
@@ -554,7 +572,9 @@ UINT WINAPI MsiRecordReadStream(MSIHANDLE handle, unsigned int iField, char *buf
rec
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_RECORD
);
if
(
!
rec
)
return
ERROR_INVALID_HANDLE
;
msiobj_lock
(
&
rec
->
hdr
);
ret
=
MSI_RecordReadStream
(
rec
,
iField
,
buf
,
sz
);
msiobj_unlock
(
&
rec
->
hdr
);
msiobj_release
(
&
rec
->
hdr
);
return
ret
;
}
...
...
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