Thanks, now it work.
DanielWehrle
Posts
-
p/invoke _stat -
p/invoke _statPInvokeStackImbalance
Message: A call to PInvoke function 'SharpFastStatWrite!SharpFastStatWrite.Writer::_stat' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.Thanks
-
p/invoke _statYes but I'm not sure what the calling conventions for the _stat call are. All I know is from: http://msdn.microsoft.com/en-us/library/14h5k7ff%28vs.71%29.aspx
-
p/invoke _statI try to do itz like: [StructLayout(LayoutKind.Sequential)] public struct STAT { public uint st_dev; public ushort st_ino; public ushort st_mode; public short st_nlink; public short st_uid; public short st_gid; public uint st_rdev; public long st_size; public long st_atime; public long st_mtime; public long st_ctime; } [DllImport("msvcrt.dll", SetLastError = true)] static extern int _stat(string file, ref STAT buf); But recive an PInvoke Imbalance Exception.
-
p/invoke _statThe pure _stat call is not my reral problem, but I have no idear how to define the struct containing the _stat result
-
p/invoke _statNo sorry it is only fclose on the linkt, I check pinvoke.net before my post and did not find anything.
-
p/invoke _statHi, does anyone know how to call _stat with p/invoke from C#? it is posible to use File.Get* instead, but I need the direct call to investigate something on the file system. Thanks
-
Get correct case of FilenameNot for windows but for Linux. And I comunicate by NFS with a Linux system.
-
Get correct case of FilenameI communicate to a case sensitiv Linux by using a NFS Server. So some incomming calls with wrong case gives errors on Linux side.
-
Get correct case of FilenameHi, I make somethin like: File.WriteAllBytes("C:\\test.TXT", mybytes); FileInfo fi = new FileInfo("C:\\test.txt"); Now fi.Fullname returns the lower case FileName, but I need to get the correct cased file name. Is there any way whithout doing a enumerate directory, and compare the strings? Thanks -- Daniel
-
The specified network name is no longer available.After my application (heavy file IO on UNC address) is running a little bit it chrashes always with: SystemIO Exception: The specified network name is no longer available. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.get_Length() On this time the Share is also not reachable by explorer, sometimes the compleate system is chrashing, on reboot I have then to kill the explorer.exe. I think I use some resources too much. What is the best way to analyse this? ProcessMonitor? WinDbg? But how? Thanks, daniel
-
Deserialise ACLs from HKLM\SOFTWARE\Classes\AppID\{ID}\LaunchPermissionsDoes anyone know a way how to deserialise and edit the acl values represented here?
-
Change DCOM Security ProgrammaticallyHi, My Web Service application make a EventLog entry with ID 10016 in case I not give the Network Service DCOM Lunch Permissions for netman. This is ok I can set the permissions by using dcomcnfg. But I do not want to do this for all installations by hand. So is there any way to set this permission programmatically. Thanks -- Daniel
-
Loosing Bytes in byte[][] while using WSE3 without MTOMHello, I wrote a little Server and run it under Win 2003 and Win 2008, [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)] [WebService(Namespace="http://www.pyramid.de", Description="Pyramid")] public class WormRaid : System.Web.Services.WebService { [WebMethod(MessageName="WriteBytes")] public long WriteBytes (byte[][] memData) { return (memData[0].Length + memData[1].Length); } } Now my problem is that the second byte array in a byte[][] is always received as 0 bytes, when the first byte[] length is a odd multiple of 1024 (1024, 3072 or ...). This error occurs only without MTOM, with MTOM everything works fine (see attached code). The error is probably in the server side because the same error can be produced with a GSoap Client (also without MTOM). Here my Client Code: internal static int Main (string[] args) { long fsize1; long fsize2; long byteswritten; byte[][] ba; WormRaid wr; Random rand = new Random(); try { fsize1 = 1024L;//only odd multiple of 1024 will not work fsize2 = 512L; Console.WriteLine(" (" + fsize1 + "), (" + fsize2 + ")\n"); // Create the data to send ba = new byte[2][]; ba[0] = new byte[(int)fsize1]; rand.NextBytes(ba[0]); ba[1] = new byte[(int)fsize2]; rand.NextBytes(ba[1]); //Create Stub wr = new WormRaid(); wr.Url = "http://localhost/WSE3Test/WSE3Test.asmx"; //First Test will work always Console.WriteLine("WSE3 MTOM:"); wr.RequireMtom = true; byteswritten = wr.WriteBytes(ba); if (byteswritten != fsize1 + fsize2) { Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2)); } else { Console.WriteLine("OK\n"); } //This test will fail Console.WriteLine("WSE3 without MTOM:"); wr.RequireMtom = false; byteswritten = wr.WriteBytes(ba); if (byteswritten != fsize1 + fsize2) { Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2));