Re: Why value changed after context switch?
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:%233vS2fcsIHA.3716@TK2MSFTNGP04.phx.gbl
"bucher" <bucher@xxxx.com> wrote in message
news:epRk22bsIHA.2068@TK2MSFTNGP05.phx.gbl
I found the value of policyBufList._Tr._Nil is not NULL in
"Policy_GetUSBDenyPolicy". But after I switched the context to
"DBIPolicy_QueryPolicyListByHosts", the value of
policyBufList._Tr._Nil was changed to NULL immediately.
_Nil is a static data member. Each module (in your case, the EXE and
the DLL) have its own separate copy of it. You are confusing yourself
when you access it as if it were a regular data member, part of the
map object you pass as a parameter: it's not.
Do you use VC6, by any chance? If so, see
http://www.dinkumware.com/vc_fixes.html
"Fix to <xtree>" section. While you are at it, you may want to apply all
the other fixes (or just switch to a modern version of VC compiler).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925