Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all 1710 articles
Browse latest View live

use of SafeArray pointer in vc++ dll to access structure Array passing from vb.net

$
0
0

hello guys ..

i am trying to implement some coding to pass a structure array from vb.net to a vc++ dll. To access the array i amusing theSafeArray pointer in vc++. I don't have a depth knowledge about the SafeArray structure, i tried to implement the program using SafeArray but i am not getting the value from the vc++ dll while i am trying to print the value from the dll that is passing from the vb.net program.

i hv just tried to implement the program and i am not sure also that i am going towards the right way implementation or not.  please help me to execute the program and get the proper value.

And please guide me if there are some other option instead of using SafeArray pointer to get the value from the vb.net structure array to a vc++ dll.

the following code i am using in vb.net 2008

'-----------------module1.vb------------------------

Public Module Module1

    Structure stickypara
        Public PID As Integer      'Parameter Id
        Public groupid As Integer      'Group Id
        Public wordNo As Integer      'Word Number
        Public subframeCode As Integer      'Subframe Code
    End Structure

    Structure ConfigTable
        Public datatype As Integer      'Datatype i.e
        Public dispType As Integer      'Display Type
        Public startBit As Integer      'Start Bit
        Public stopBit As Integer      'Stop bit
        
    End Structure

    Public para As ConfigTable() = New ConfigTable(50) {}  'Array of ConfigTable structure
    public spara As stickypara() = New stickypara(50) {}
    Dim indx As Integer = 0
    Dim stickyindex As Integer = 0



    Public Declare Sub DatabaseInitialization Lib "foqadll.dll" (ByVal para() As ConfigTable, ByVal spara() As stickypara)


End Module
'-----------------------from1.vb--------------------

Public Class Form1



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Try

            While (indx <= 50)
                para(indx).datatype = 0
		para(indx).dispType = 5
                para(indx).startBit = 3
                para(indx).stopBit = stpbt - 1
                indx = indx + 1
            End While

            While (stickyindex <= 50)
                spara(stickyindex).PID = stickyindex
                spara(stickyindex).groupid = 9
                spara(stickyindex).wordNo = 1
                spara(stickyindex).subframeCode = 115
                stickyindex = stickyindex + 1
            End While
        Catch ex As Exception
            MsgBox("Error!" & ex.Message)
        End Try

      


        DatabaseInitialization(para, spara)

    End Sub
End Class

and for the dll i am using the vc++ 2008 , and the code as following

//---------------header file (struct.h)-----------------

#include <ole2.h>
#include <OAIdl.h>
#include <stdio.h>

typedef struct 
{
	
	 int		datatype      ; 
	 int    	disptype      ;
	 int		startbit      ;
	 int		stopbit       ;
	

}PARAMETERS; 

typedef struct
{
	 int		pid           ; 
	 int     	groupid       ;  
	 int		wordno        ; 
	 int		subframecode  ; 

}STICKYPARAMETERS;


PARAMETERS				*PARATable      ;
STICKYPARAMETERS			*STICKYTable    ;
//-------------------------foqadll.cpp--------------------
#include "struct.h"

void _stdcall DatabaseInitialization(LPSAFEARRAY *ptrParamData, LPSAFEARRAY *ptrStickyData)
{


	PARAMETERS		*ParaFiles	;

	STICKYPARAMETERS 	*StickyFiles	;


	char str4[255];

	sprintf(str4,"(*ptrParamData)->rgsabound->cElements is %d\n\n(*StickyFiles)->rgsabound->cElements is %d ",(*ptrParamData)->rgsabound->cElements,(*StickyFiles)->rgsabound->cElements);
	MessageBoxA(NULL, str4, " NULL ", MB_OK );

	ParaFiles=(PARAMETERS *)((*ptrParamData)->pvData);
	StickyFiles=(STICKYPARAMETERS*)((*StickyFiles)->pvData);
		for(int i=0;i<(*ptrParamData)->rgsabound->cElements;i++)
			{
				sprintf(str4,"%d\n%d\n%d\n%d\n",
					ParaFiles[i].datatype,
					ParaFiles[i].disptype,
					ParaFiles[i].startbit,
					ParaFiles[i].stopbit);
				MessageBoxA(NULL, str4, " NULL ", MB_OK );
			}
		for(int j=0;j<(*StickyFiles)->rgsabound->cElements;j++)
			{
				sprintf(str4,"%d\n%d\n%d\n%d\n",
					StickyFiles[j].pid,
					StickyFiles[j].groupid,
					StickyFiles[j].wordno,
					StickyFiles[j].subframecode);
				MessageBoxA(NULL, str4, " NULL ", MB_OK );
			}


	MessageBoxA(NULL, "dll function  executed", " NULL ", MB_OK );
}
//--------------foqadll.def---------------------

LIBRARY	"foqadll"

EXPORTS

DatabaseInitialization	


c# 4.5.1 MarshalAs(UnmanagedType.BStr) bug

$
0
0

I have a program in c# that calls a number of powerbasic created dlls.  Each dll has one exported function that takes an int and a Bstr as input and returns a Bstr.  The following is a simplified example that demonstrates the exact same problem:

Function DllTestCmd(ByVal Cmd As Long,ByVal CmdStr As WString) ThreadSafe Export As WString
    Local c$
    c$ = cmdStr
    Function = c$ + $CrLf + "Ok!"
End Function

Here's the c# declaration:

         [DllImport("DllTest.dll", EntryPoint = "DLLTESTCMD")]
        [returnMarshalAs(UnmanagedType.BStr)]
        private static extern string DLLTESTCMD(int cmd, [MarshalAs(UnmanagedType.BStr)] string commandString);

Calling this function is the following C# code:

         void Button1Click(object sender, EventArgs e)
        {
            unsafe {
                string x = "Hi There";                
                string ret = DLLTESTCMD(1,x);
                label1.Text = ret;                        
            }
        }

If I compile the c# code in dot net 4.0 all is well.  However if I simply change to compile with 4.5.1, the c# program does not return from the dll and simply disappears, no crash info at all, even in debug mode.

If I change the exported function to:

Function DllTestCmd(ByVal Cmd As Long,ByVal CmdStr As String) ThreadSafe Export As WString
    Local c$
    c$ = cmdStr
    Function = c$ + $CrLf + "Ok!"
End Function

(changing the passed string to ansi bstr) and the c# declaration to:

         [DllImport("DllTest.dll", EntryPoint = "DLLTESTCMD")]
        [returnMarshalAs(UnmanagedType.BStr)]
        private static extern string DLLTESTCMD(int cmd, [MarshalAs(UnmanagedType.AnsiBStr)] string commandString);

and then call the dll, it does work.  But it seems that 4.5.1 has some sort of bug inMarshalAs(UnmanagedType.BStr).

I would change everything to the way that it works, but I've also seen some situations in 4.5.1 where it crashed with a debug error saying there is a memory corruption.  That looks like the GC is jumping the gun and moving things around in memory while I'm in the dll.

Thanks,

Russ

Is SynchronizationContext using InvokeRequired?

$
0
0

Hi,

When using Invoke you usally also check the InvokeRequired, how does this work with SynchronizationContext (Send/Post)? Will it internally check InvokeRequired or is it more or less the same as just running Invoke/BeginInvoke and no InvokeRequired check?

both mscorlib 2.0 and 4.0 referenced in a library, safe or not ? (and 2.0.5.0 in case of PCL ?)

$
0
0

I have a strange problem with a referenced library which target both mscorlib 4.0 and mscorlib 2.0, resulting in warnings when I reference this library in further libraries.

To reproduce this problem you need to create a really specific code :

One library A will target the lowest targeted framework (2.0 or PCL )

One library B will target framework 4.5

When you compile library B, it will reference both mscorlib 4 and mscorlib 2.0 (2.0.5.0 in the case of the PCL library).

1) Create a class library A project (targeting fwk 2 or pcl)

2) Create a public class "MyException", inheriting from Exception and with nothing special (3 usual ctors + protected serialization constructor in the case of the .net 2.0 version).

3) Create a class library B project, targeting fwk 4.5

4) Use the following code :

namespace B
{
    public class Class1
    {
        public void Method1()
        {
            try
            {
                new System.Guid("hello world!");
            }
            catch (System.Exception ex)
            {
                // no reference to mscorlib 2.0
                throw new A.MyException("");

                // add reference to mscorlib 2.0 AND 4.0
                //throw new A.MyException("", ex);
            }
        }
    }
}


5) Compile library B : it references only mscorlib 4.0.

6) Comment first throw, uncomment the second one. Compile library B : it references both mscorlib versions.

See ths following ILASM :

// Metadata version: v4.0.30319
.assembly extern mscorlib
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 4:0:0:0
}
.assembly extern Framework20Lib
{
  .ver 1:0:0:0
}
.assembly extern mscorlib as mscorlib_2
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 2:0:0:0
}

Why this behavior ? For me it's not safe to reference both versions of the same library, and, more important about the PCL version, it results in warning in further code because now you library need a specific mscorlib version (2.0.5.0) which does not exists at all.

Basically, my problem is not a runtime problem, but a Visual Studio one : I have some project referencing this specific libraries which now complains at build time (in ResolveAssemblyReferences MS Build tasl) about conflicts between multiple versions of mscorlib. I does not display always, only after x transitive references.

I will try to understand why it's only displayed in certains cases in VS and not all...

Assembly resolution in hosted environment

$
0
0

Hi,

the issue arises in the following context:

MS Word -> .dot -> unmanaged library A (vb6) -> managed library B -> managed library C

The managed libraries are not strongly named and not signed.

Library B can resolve the reference to library C if the version of library C is the one it was at compile time of library B. However, if we produce a new version of library C only by increasing the assembly version number, assembly resolution fails.

Since there are hundreds of assemblies like library B that reference library C we would like to avoid recompilation and delivery of all of them for every new version of library C.

When using it in a context like

managed process -> managed library B -> managed library C

resolution of references to library C will always work, even if the version number of library C differs.

This leads to the conclusion that assembly resolution is different in the two contexts.

My question is, why assembly resolution is different in the first context and how it is exactly working then.

We used fuslogvw to see why resolution fails and it was obvious that in the first context with differing version numbers only the word-application path is being probed but with matching version number the assembly is found in its directory (the directory where library B resides, too).

Let's assume we cannot change library B to use dynamic loading an the likes.

Regards

CLR Profiling API problem: IL rewriting issue "System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances"

$
0
0

Failure details: System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
   at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
   at com.altaworks.da.DsaPortRequestor.getPortUsingSocket(String hostName, Int32 httpPort)

This problem seems to match another blog posting on the Microsoft Forums and in that case a profiler was in the picture as well. The suggestion there was to turn off legacy code access security. Turning off legacy code access security ("LegacyCASModel=false") will fix the issue but that is not an acceptable solution.

The application profiled is a SharePoint 2013 application. Through IL rewriting the profiler is adding an assembly reference to an external helper assembly that is associated with the unmanaged profiler. That assembly is being loaded into the shared app domain apparently with Full Trust and in a Security Transparent manner. The problem was reproduced on Windows 7 but was first reported on W2k12-R1 and W2K12-R2. 

The helper assembly is attempting to send profiling data collected to another process.

Security Rule Set: Level1
Is Fully Trusted: True
Zone Evidence: MyComputer
Security Critical: False
Security SafeCritical: False
Security Transparent: True
Operating System: Windows 7 (Microsoft Windows NT 6.2.9200.0)
OS Version: 6.2.9200.0
.NET Version: 4.0.30319.18046
CLR running in: 64 bit mode

ICorProfilerEvents out of sequence.

$
0
0

Hi everybody. I am working on a profiling agent. Among other things it analyzes the active threads' status. To be successful it has to match thread names to IDs. Here is a problem though: When I run a simple test case that creates several threads and sets a name for each one, I get ThreadNameChanged notifications fired before ThreadCreated. Below is WinDbg output from breakpoints set for the appropriate events:

ModLoad: 000007fe`e57f0000 000007fe`e5aa4000   C:\vlh\Builds\X64\My\OciVOB\DevInstall_debug\X64\Purify.rsc
ThreadCreated 9021472
ThreadCreated 9130704
ModLoad: 000007fe`de930000 000007fe`dee1a000   mscorlib.dll
ModLoad: 00000000`04c70000 00000000`0515a000   mscorlib.dll
ModLoad: 000007fe`fb7b0000 000007fe`fb7bc000   C:\Windows\system32\VERSION.dll
ModLoad: 000007fe`de930000 000007fe`dee1a000   C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
ModLoad: 000007fe`eb990000 000007fe`ebac1000   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
ThreadNameChanged 86305504 Test_0
ThreadNameChanged 86386128 Test_1
ThreadNameChanged 86389968 Test_2
ThreadNameChanged 86393808 Test_3
ThreadNameChanged 86397648 Test_4
ThreadNameChanged 86358608 Test_5
ThreadNameChanged 86361872 Test_6
ThreadNameChanged 86365136 Test_7
ThreadNameChanged 86368976 Test_8
ThreadNameChanged 86372816 Test_9
ThreadCreated 86305504
ThreadCreated 86386128
ThreadCreated 86389968
ThreadCreated 86393808
ThreadCreated 86397648
ThreadCreated 86358608
ThreadCreated 86361872
ThreadCreated 86365136
ThreadCreated 86368976
ThreadCreated 86372816

The problem is: I register thread information on ThreadCreated event and then update it as other events come in, so out-of-sequence events throw the analysis off.

Of course I can map thread IDs to thread information blocks and re-sequence the incoming events. But common, doesn't this violate the whole "Cause and effect" premise?

Regards,

Victor

COM interop and CLSCTX_ENABLE_CLOAKING

$
0
0
Is it possible to create out-of-proc COM object while thread is impersonating (analog of native CLSCTX_ENABLE_CLOAKING)?

Troubles loading C++\CLI assembly in a WebApp with IIS 6

$
0
0

We are upgrading .NETweb application to .Net Framework 4.0 and recompile in VS 2010.

The application uses several boost dlls. We got below error. But it same issue didn't happen in the past when we use VS 2008 on Window Vista. The error is occuring when we rebuild on Window 7

The operation failed.
Bind result: hr = 0x80131018. No description available.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\WINDOWS\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = IIS APPPOOL\DefaultAppPool
LOG: DisplayName = boost_thread-vc100-mt-1_47


ERR: Error extracting manifest import from file (hr = 0x80131018).
ERR: Setup failed with hr = 0x80131018.
ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.

need help on code access permissions for a plugin system

$
0
0

Hello

I've developed a plugin system for my server based application. Users can write their own code for manipulating the main application and this code is compiled and invoked by Activatore.CreateInstance method.

Now I want to put some restrictions on what users can do. I mean they must not be able to perform file operations, call other unmanaged code, use UI, ...

My architecture is like this:

public class Macrobase

{

public virtual void Event1(ref Data_from_Main_App a)

{

}

public virtual void Event2(ref Data_from_Main_App a)

{

}

....

}

then each plugin is a child class of MacroBase class and these events are overriden.

I want to add attributes like:

[System.Security.Permissions.FileIOPermission(SecurityAction.PermitOnly,Unrestricted=false)]

to Macrobase Class so that child customized class is restricted from doing unwanted things.

So, what my question is?

Getting to know all tips and tricks of security namespace seems to be a distinguished experty.  I want a quick guide about:

1- what measures shall I take to avoid my security attributes to be overridden by child class?

2- I need a correct sample of defining security attributes considering the fact that there is usually no condition in restricting my user c# scripts; every operation which seems dangerous to server must be restricted unconditionally for all end users/developers. e.g. is applying SecurityAction.PermitOnly,Unrestricted=false to all classes of 'System.Security.Permissions' conservatively safe?

3- in 'System.Security.Permissions' there are classes which need vast experience of security work to understand what they do, e.g: zonidentity, hostprotection, principalpermission, etc. My question is: shall I apply a permitonly attribute by all of these classes for my pluging system? is there a brief article about it?

Thanks in advance

Access Violation in .NET 4 Runtime in gc_heap::garbage_collect with no unmanaged modules

$
0
0

Hi all,

We are experiencing an access violation in the .NET 4.0 runtime, in a piece of code that uses NHibernate heavily. None of our own code interops with native code directly, nor does the 3rd party code we are using (to the best of our knowledge). We cannot identify the memory pattern that is appears to be corrupting the GC heap, and we don't know whether the problem is in the GC itself or in some other piece of code that is corrupting it.

I've included below the stack trace of the offending thread, and the list of loaded modules.

We need some help debugging this issue. What should we do next?

Thanks,
Adam Smith
Director, Technology
Hubbard One
Thomson Reuters

 

0:000> !EEStack
---------------------------------------------
Thread   0
Current frame: clr!WKS::gc_heap::find_first_object+0x64
ChildEBP RetAddr  Caller, Callee
0012bf30 791fa5b8 clr!WKS::gc_heap::mark_through_cards_for_segments+0x116, calling clr!WKS::gc_heap::find_card
0012bf38 791fa618 clr!WKS::gc_heap::mark_through_cards_for_segments+0x563, calling clr!WKS::gc_heap::find_first_object
0012bfc4 791faaa1 clr!WKS::gc_heap::relocate_phase+0x5b, calling clr!WKS::gc_heap::mark_through_cards_for_segments
0012c000 791f7a52 clr!WKS::gc_heap::plan_phase+0x851, calling clr!WKS::gc_heap::relocate_phase
0012c038 791a1be6 clr!HndScanHandlesForGC+0x125, calling clr!_EH_epilog3
0012c03c 791a2424 clr!Ref_ScanDependentHandlesForClearing+0x61, calling clr!HndScanHandlesForGC
0012c044 791a2291 clr!SyncBlockCache::GCWeakPtrScan+0x61
0012c0dc 791f73d1 clr!WKS::gc_heap::gc1+0x140, calling clr!WKS::gc_heap::plan_phase
0012c100 791f7972 clr!WKS::gc_heap::garbage_collect+0x3ae, calling clr!WKS::gc_heap::gc1
0012c118 791f6edd clr!WKS::gc_heap::soh_try_fit+0x16b, calling clr!WKS::gc_heap::a_fit_segment_end_p
0012c184 791f771f clr!WKS::GCHeap::GarbageCollectGeneration+0x17b, calling clr!WKS::gc_heap::garbage_collect
0012c1a8 791f6b68 clr!WKS::gc_heap::try_allocate_more_space+0x23a, calling clr!WKS::gc_heap::allocate_small
0012c1b0 791f878a clr!WKS::gc_heap::try_allocate_more_space+0x162, calling clr!WKS::GCHeap::GarbageCollectGeneration
0012c1d4 791f6b82 clr!WKS::gc_heap::allocate_more_space+0x13, calling clr!WKS::gc_heap::try_allocate_more_space
0012c1e8 791f6e65 clr!WKS::GCHeap::Alloc+0x3d, calling clr!WKS::gc_heap::allocate_more_space
0012c208 7919c953 clr!Alloc+0x8d
0012c224 7916089d clr!SlowAllocateString+0x42, calling clr!Alloc
0012c258 7919c876 clr!HelperMethodFrame::LazyInit+0x17, calling  (JitHelp: CORINFO_HELP_GET_THREAD)
0012c264 79160973 clr!FramedAllocateString+0xc9, calling clr!SlowAllocateString
0012c2ac 791608f6 clr!FramedAllocateString+0x18, calling clr!LazyMachStateCaptureState
0012c2e0 0703bec0 (MethodDesc 06ba8e80 +0xf0 NHibernate.Engine.Cascade.DeleteOrphans(System.String, NHibernate.Collection.IPersistentCollection)), calling clr!JIT_IsInstanceOfInterface
0012c300 79b3781c (MethodDesc 798fbdcc +0x7c System.String.Concat(System.String, System.String)), calling 00972350
0012c318 06bcadf0 (MethodDesc 06ba8e74 +0x2f0 NHibernate.Engine.Cascade.CascadeCollectionElements(System.Object, NHibernate.Type.CollectionType, NHibernate.Engine.CascadeStyle, NHibernate.Type.IType, System.Object, Boolean)), calling (MethodDesc 798fbdcc +0 System.String.Concat(System.String, System.String))
0012c34c 06bcaab9 (MethodDesc 06ba8e5c +0x99 NHibernate.Engine.Cascade.CascadeCollection(System.Object, NHibernate.Engine.CascadeStyle, System.Object, NHibernate.Type.CollectionType)), calling (MethodDesc 06ba8e74 +0 NHibernate.Engine.Cascade.CascadeCollectionElements(System.Object, NHibernate.Type.CollectionType, NHibernate.Engine.CascadeStyle, NHibernate.Type.IType, System.Object, Boolean))
0012c380 06bcaa07 (MethodDesc 06ba8e50 +0x77 NHibernate.Engine.Cascade.CascadeAssociation(System.Object, NHibernate.Type.IType, NHibernate.Engine.CascadeStyle, System.Object, Boolean)), calling (MethodDesc 06ba8e5c +0 NHibernate.Engine.Cascade.CascadeCollection(System.Object, NHibernate.Engine.CascadeStyle, System.Object, NHibernate.Type.CollectionType))
0012c3a0 06bc7f7d (MethodDesc 06ba8e2c +0x4d NHibernate.Engine.Cascade.CascadeProperty(System.Object, NHibernate.Type.IType, NHibernate.Engine.CascadeStyle, System.Object, Boolean)), calling (MethodDesc 06ba8e50 +0 NHibernate.Engine.Cascade.CascadeAssociation(System.Object, NHibernate.Type.IType, NHibernate.Engine.CascadeStyle, System.Object, Boolean))
0012c3c4 06bc7c99 (MethodDesc 06ba8e20 +0x159 NHibernate.Engine.Cascade.CascadeOn(NHibernate.Persister.Entity.IEntityPersister, System.Object, System.Object)), calling (MethodDesc 06ba8e2c +0 NHibernate.Engine.Cascade.CascadeProperty(System.Object, NHibernate.Type.IType, NHibernate.Engine.CascadeStyle, System.Object, Boolean))
0012c40c 06bcb8a4 (MethodDesc 04b699a0 +0x64 NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(NHibernate.Event.IEventSource, NHibernate.Persister.Entity.IEntityPersister, System.Object, System.Object)), calling (MethodDesc 06ba8e20 +0 NHibernate.Engine.Cascade.CascadeOn(NHibernate.Persister.Entity.IEntityPersister, System.Object, System.Object))
0012c440 06bcb793 (MethodDesc 04b69994 +0xf3 NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(NHibernate.Event.IEventSource)), calling (MethodDesc 04b699a0 +0 NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(NHibernate.Event.IEventSource, NHibernate.Persister.Entity.IEntityPersister, System.Object, System.Object))
0012c47c 06bcb388 (MethodDesc 04b69968 +0x88 NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(NHibernate.Event.FlushEvent)), calling (MethodDesc 04b69994 +0 NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(NHibernate.Event.IEventSource))
0012c4b0 06bcb24d (MethodDesc 04b69b74 +0x2d NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(NHibernate.Event.FlushEvent))
0012c4c4 06bcb195 (MethodDesc 02af3330 +0xd5 NHibernate.Impl.SessionImpl.Flush()), calling 057f5e72

            Base TimeStamp                     Module
          400000 48ebcdd3 Oct 07 17:00:03 2008 X:\ContactNet\bin\NAnt.exe
        7c800000 49900d60 Feb 09 06:02:56 2009 C:\WINDOWS\system32\ntdll.dll
        79000000 4af3af84 Nov 06 00:09:24 2009 C:\WINDOWS\system32\mscoree.dll
        77e40000 49c51f0a Mar 21 13:08:26 2009 C:\WINDOWS\system32\KERNEL32.dll
        7d1e0000 4a61f120 Jul 18 11:58:24 2009 C:\WINDOWS\system32\ADVAPI32.dll
        77c50000 49f5889a Apr 27 06:27:38 2009 C:\WINDOWS\system32\RPCRT4.dll
        76f50000 4a3742b4 Jun 16 02:59:00 2009 C:\WINDOWS\system32\Secur32.dll
        603b0000 4ba1d8a9 Mar 18 03:39:21 2010 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
        77da0000 45d70ac0 Feb 17 09:01:36 2007 C:\WINDOWS\system32\SHLWAPI.dll
        77c00000 4900637a Oct 23 07:43:54 2008 C:\WINDOWS\system32\GDI32.dll
        77380000 45e7c676 Mar 02 01:38:46 2007 C:\WINDOWS\system32\USER32.dll
        77ba0000 45d70b06 Feb 17 09:02:46 2007 C:\WINDOWS\system32\msvcrt.dll
        76290000 45d70a5f Feb 17 08:59:59 2007 C:\WINDOWS\system32\IMM32.DLL
        79140000 4ba1d9ef Mar 18 03:44:47 2010 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
        79060000 4ba1dbf2 Mar 18 03:53:22 2010 C:\WINDOWS\system32\MSVCR100_CLR0400.dll
        79880000 4ba1da6f Mar 18 03:46:55 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\mscorlib\246f1a5abb686b9dcdf22d3505b08cea\mscorlib.ni.dll
        77670000 45d70aa5 Feb 17 09:01:09 2007 C:\WINDOWS\system32\ole32.dll
        4b3c0000 45d70ab2 Feb 17 09:01:22 2007 C:\WINDOWS\system32\MSCTF.dll
        60340000 4ba1d8aa Mar 18 03:39:22 2010 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\culture.dll
        60930000 4ba1d8ae Mar 18 03:39:26 2010 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll
        79810000 4ba1da36 Mar 18 03:45:58 2010 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
        68000000 45d69786 Feb 17 00:49:58 2007 C:\WINDOWS\system32\rsaenh.dll
        76b70000 45d70ab5 Feb 17 09:01:25 2007 C:\WINDOWS\system32\PSAPI.DLL
         32e0000 45d69418 Feb 17 00:35:20 2007 C:\WINDOWS\system32\xpsp2res.dll
        77b90000 45d70ac8 Feb 17 09:01:44 2007 C:\WINDOWS\system32\VERSION.dll
        7a820000 4ba1dff4 Mar 18 04:10:28 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System\964da027ebca3b263a05cadb8eaa20a3\System.ni.dll
        60c90000 4ba1e04b Mar 18 04:11:55 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Configuration\ac18c2dcd06bd2a0589bac94ccae5716\System.Configuration.ni.dll
        69720000 4ba1dfec Mar 18 04:10:20 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Xml\e997d0200c25f7db6bd32313d50b729d\System.Xml.ni.dll
        6f350000 4a4eaae7 Jul 03 21:05:43 2009 C:\WINDOWS\system32\urlmon.dll
        77d00000 4760e409 Dec 13 02:49:29 2007 C:\WINDOWS\system32\OLEAUT32.dll
        40a90000 4a4eaae8 Jul 03 21:05:44 2009 C:\WINDOWS\system32\iertutil.dll
        77420000 45d70a05 Feb 17 08:58:29 2007 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55\comctl32.dll
        7c8d0000 485819a8 Jun 17 16:08:08 2008 C:\WINDOWS\system32\SHELL32.dll
        44f20000 4ba1e740 Mar 18 04:41:36 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\Microsoft.Build.Fra#\11ef4be6ee227fce3725d6df534297a4\Microsoft.Build.Framework.ni.dll
        60e50000 4ba1dfee Mar 18 04:10:22 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Core\713647b987b140a17e3c4ffe4c721f85\System.Core.ni.dll
        67160000 4ba1e0c5 Mar 18 04:13:57 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Web\a70842538614699d690561ef5f43598b\System.Web.ni.dll
        5e0d0000 4ba2183b Mar 18 08:10:35 2010 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll
        60650000 4ba1db8f Mar 18 03:51:43 2010 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\ISymWrapper\v4.0_4.0.0.0__b03f5f7f11d50a3a\ISymWrapper.dll
        61750000 4ba1e064 Mar 18 04:12:20 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Data\92cccedc7cda413ff6fc6492cb256b58\System.Data.ni.dll
         4e00000 4ba1e064 Mar 18 04:12:20 2010 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll
        71c00000 45d70ae9 Feb 17 09:02:17 2007 C:\WINDOWS\system32\WS2_32.dll
        71bf0000 45d70aea Feb 17 09:02:18 2007 C:\WINDOWS\system32\WS2HELP.dll
        761b0000 45d70a80 Feb 17 09:00:32 2007 C:\WINDOWS\system32\CRYPT32.dll
        76190000 45d70aac Feb 17 09:01:16 2007 C:\WINDOWS\system32\MSASN1.dll
        766d0000 45d70abc Feb 17 09:01:32 2007 C:\WINDOWS\system32\shfolder.dll
        666d0000 4ba1e09d Mar 18 04:13:17 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Transactions\dd9dbf82e44454689976a49a9e4ddb6d\System.Transactions.ni.dll
        66680000 4ba1e09d Mar 18 04:13:17 2010 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll
        65d70000 4ba1df90 Mar 18 04:08:48 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.EnterpriseSe#\8b6e9d6171aad3561263ce2cd05c57df\System.EnterpriseServices.ni.dll
        10020000 4ba1db80 Mar 18 03:51:28 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.EnterpriseSe#\8b6e9d6171aad3561263ce2cd05c57df\System.EnterpriseServices.Wrapper.dll
        10000000 4ba1db80 Mar 18 03:51:28 2010 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll
        71f60000 3e8024bc Mar 25 05:43:24 2003 C:\WINDOWS\system32\security.dll
        76750000 4a3742b4 Jun 16 02:59:00 2009 C:\WINDOWS\system32\schannel.dll
        76920000 45d70ac8 Feb 17 09:01:44 2007 C:\WINDOWS\system32\USERENV.dll
        71c40000 48f7bdc3 Oct 16 18:18:43 2008 C:\WINDOWS\system32\NETAPI32.dll
        48060000 434f63fa Oct 14 03:53:30 2005 C:\Program Files\Microsoft SQL Server\90\Shared\instapi.dll
        78130000 4889d619 Jul 25 09:33:13 2008 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.3053_x-ww_B80FA8CA\MSVCR80.dll
        68100000 45d6978b Feb 17 00:50:03 2007 C:\WINDOWS\system32\dssenh.dll
        66230000 4ba1dfda Mar 18 04:10:02 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Numerics\b07f0d26a34ad53fc369248f289d1126\System.Numerics.ni.dll
        66510000 4ba1df78 Mar 18 04:08:24 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Security\09a97525ae5583cc2685e2c39a3078bd\System.Security.ni.dll
        7b1d0000 4ba1e086 Mar 18 04:12:54 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Drawing\dd57bc19f5807c6dbe8f88d4a23277f6\System.Drawing.ni.dll
        68df0000 4ba1e1a5 Mar 18 04:17:41 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Web.Services\149f2dcb9c9706e592d1980a945850c2\System.Web.Services.ni.dll
        51860000 4ba1f498 Mar 18 05:38:32 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.ServiceModel\250b525aa8c17327216e102569c0d766\System.ServiceModel.ni.dll
        66610000 4ba1e143 Mar 18 04:16:03 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.ServiceProce#\6e7f1bdc845816dfc797f8002b76b5e8\System.ServiceProcess.ni.dll
        52d30000 4ba1f585 Mar 18 05:42:29 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.ServiceModel#\51c60db370e050d9cdcac17060aaac53\System.ServiceModel.Web.ni.dll
        51130000 4ba1f437 Mar 18 05:36:55 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Runtime.Seri#\e9f8a45b1063d6c6a62718c88a5623d1\System.Runtime.Serialization.ni.dll
        63d00000 4ba1e082 Mar 18 04:12:50 2010 C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Data.OracleC#\db33744fb49e77c7233adb50f07fe62a\System.Data.OracleClient.ni.dll
        63c80000 4ba1e082 Mar 18 04:12:50 2010 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data.OracleClient\v4.0_4.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll

ConfigurationSectionCollection contains many system names besides my custom section

$
0
0

Here is my config file:

<?xml version="1.0" encoding="utf-8" ?><configuration><configSections><section name="MySection" type="MyApp.MySectionClass, MyApp"/></configSections><MySection name="SomeName" data_type="SomeDataType" file_name="file">	<CollectionName><add name="name1" param="-10" ping="3"/><add name="name1" param="-10" ping="5"/><add name="name2" param="-10" ping="3" param2="0.3" param3="0.2"/></CollectionName></MySection ></configuration>

Here is the code where i try just to have a list of my names of sections in my config file:

ExeConfigurationFileMap map = new ExeConfigurationFileMap();
map.ExeConfigFilename = "path\\app.config";
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
ConfigurationSectionCollection section_collection = config.Sections;

foreach (string key in section_collection.Keys) Console.WriteLine(key);

Here what i get as a result:

system.data.sqlclient
connectionStrings
system.webServer
system.data.dataset
satelliteassemblies
mscorlib
startup
runtime
appSettings
system.data.odbc
system.data
configProtectedData
system.codedom
uri
system.runtime.remoting
assemblyBinding
windows
system.data.oracleclient
MySection
system.windows.forms
system.diagnostics
system.data.oledb

As you can see there is my section name, but also a lot of other namespaces. Why does it happen? How can i get only my custom sections from app.config? I don't know sections' names and number of them beforehand. That's why i want to iterate over the section collection.

Thanks.


How would you push login credentials to a landing page?

$
0
0

I am looking into a solution for pushing a user's login credentials to a landing page with options for different sites to go to.

Basically the user will sign in and then be redirected to a landing page with three buttons that the user will choose which site to access.

Has anyone tried to build anything like this?  

Thanks in advance.


M Novak

What is the use of Password datatype on the ComponentModel.DataAnnotations?

$
0
0

I applied this annotation of type Password to one of my attribute on the DataModel attribute like following

[Required, DataType(DataType.Password)]
public string Password { get; set; }

but there is not enough documentation I found on MSDN or on the Net that what kind of validation does it imply on the model. Can someone please share some information on this one?


Asp.Net, SQL, T-SQL, JavaScript, C# Developer


Microsoft Speech Platform Generated WAV licencing

$
0
0

Hello,

I'd like to know the license attached to the sound (wav) files generated by the Microsoft Speech Platform TTS API. I know that the license of the platform itself can be used for commercial software, but what about the wav files it can generate? Can them be used in a context where there's no SAPI involved?

My personal take on the issue is that the Platform can be used for any purpose to create an application, so I can create an application myself to generate the wav files. Then, since it's my application that generated the wav files (an application that I do have the right to create using the library), then I should be able to use those wav files for any purpose.

However, I am no expert so I'd like to know for sure whether I can use those files for commercial purposes or not.

I've found a gliche a bug that is potentially hackable forget security for user accounts

$
0
0
potential bug when deleting and creating accounts :)

Profiler works only with admin privileges

$
0
0
I'm working on a .NET profiler that monitors all .NET processes (environment variables are set globally (system and current user variables)), the profiler works fine when a process is run with admin privileges however, when I run a .NET process with normal privileges, the dll is not loaded. Where could be the problem. Any help would be appreciated.

mshtml failing to work in release mode

$
0
0

hi,

mshtml works perfectly when built in debug mode.

But if the mshtml is built in release mode when a single user access the dll we find no issue.

but when multiple user access the dll, we get COM Exception & RPC_ServerFault,Remote connection forcibly closed.

Force no string interning.

$
0
0
I have an application that crashes due to an OutOfMemoryException. It uses a great deal of unique strings during its processing. In order to avoid this OutOfMemoryException, I have forced it to terminate after completing one unit of work and am calling it repeatedly with a batch script with an infinite loop. I would be very happy if you would support forcing no string interning. CompilationRelaxationg.NoStringInterning does not work the way you would expect it. Thank you.

Marshal.FreeHGlobal(bufferIntPtr) memory leak used in HttpModule Callback

$
0
0

In HttpModule callback, Marshal.AllocHGlobal(size) is ued to initialized a buffer pointer for unmanaged code processing. After processing,  use Marshal.FreeHGlobal to free it. But memory leak is observed.

When calling the same logic in a standalone c# application, no memory leak problem.

The code logic is about the same as below: 

Viewing all 1710 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>