similar to: Code formatting with VS 2008?

Displaying 20 results from an estimated 10000 matches similar to: "Code formatting with VS 2008?"

2008 May 06
4
DeviceIoControl + IOCTL_DISK_GET_DRIVE_GEOMETRY problem
Hi all, Ok, what am I doing wrong here? require ''windows/device_io'' require ''windows/handle'' require ''windows/error'' include Windows::DeviceIO include Windows::Handle include Windows::Error fh = File.open(''test.txt'') # Assume you have this handle = get_osfhandle(fh.fileno) if handle == INVALID_HANDLE_VALUE puts
2008 Apr 30
8
Playing with NtQueryInformationFile
Hi all, I''m trying to get the allocation size of a file via a file handle (rather than its name). The example below works for FileNameInformation but I can''t get it to work as expected for FileStandardInformation. Here''s some sample code: # query_test.rb require ''windows/handle'' require ''windows/error'' include Windows::Handle
2008 Jul 08
12
Some more win32-security: SID.create
Hi all, How does this look as a general approach to a SID.create method: # Creates and initializes def self.create(authority, *sub_authorities) if sub_authorities.length > 8 raise ArgumentError, ''maximum of 8 subauthorities allowed'' end authorities = Array.new(8, 0) authorities.replace(sub_authorities) count = authorities.select{ |e| e > 0 }.size
2008 Nov 10
4
PathFindExtension and wide strings
Hi, What''s happening here? require ''windows/path'' require ''windows/unicode'' include Windows::Path include Windows::Unicode file_a = ''bar.txt'' file_w = multi_to_wide(file_a) p PathFindExtensionA(file_a) # ''.txt'' => OK p PathFindExtensionW(file_w) # ''.'' => WRONG Is Ruby chopping the
2007 Aug 04
10
Need some help with pure Ruby win32-changenotify
Hi all, I know it''s deprecated, but people seem to still be using win32-changenotify, so I thought I''d see if I could make it pure Ruby. Also, I thought it would be a good opportunity to test passing a custom Win32::Event object. I''m mostly done I think, but I''m having trouble unraveling the FILE_NOTIFY_INFORMATION struct buffer. Please check out the
2004 Jan 22
1
Latest win32-service error
I''m getting an error when I run the test2.rb script. I get this error: C:\eclipse\workspace\win32-service-0.3.0\test>ruby test2.rb install installed C:\eclipse\workspace\win32-service-0.3.0\test>ruby test2.rb start (Win32ServiceError)t'': Overlapped I/O operation is in progress. from test2.rb:42 Any ideas? Also, it looks like the output from ErrorDescription()
2008 Jan 23
6
JRuby and callbacks?
Hi all, Any Java/JRuby folks on the list? I''d like to see if we can implement api.c for JRuby using JNA and see how it handles the callbacks. I''m not a Java guy, nor do I know JNA, but I''ll take a stab at it if no one else on the list does. Here are a couple of useful links: http://www.infoq.com/news/2007/09/jna-jruby https://jna.dev.java.net/ Regards, Dan This
2007 Aug 08
12
Some more win32-changenotify analysis
Hi all, I decided to check the responsiveness of the pure Ruby vs C extension versions of win32-changenotify. I setup this little file generator program: a = [] 10.times{ |n| a << Thread.new{ File.open("File_#{n}", ''w''){ |fh| fh.puts "test #{n}" } } } a.each{ |t| t.join } The pure Ruby version did not do so well. In some cases it
2012 May 18
7
Dir.create_junction with FFI
Hi, Try as I might, I just cannot get Dir.create_junction to work with FFI in the ffi branch of the win32-dir project. The problem is the REPARSE_JDATA_BUFFER struct. I''m just not sure how to set those members, specifically, the PathBuffer member. The target looks good, it''s UTF-16LE encoded, but I can''t make it work, despite trying several ways of defining the struct,
2008 Jun 04
3
Ruby 1.8.7
Hi all, Has anyone else been able to build Ruby 1.8.7 from source on Windows? I get this when I run configure: C:\>win32\configure.bat find: =: No such file or directory Creating Makefile Creating Makefile(6) : fatal error C1085: Cannot write compiler generated file: '''': Invalid argument NMAKE : fatal error U1077: ''cl'' : return code ''0x1''
2008 Jun 10
7
Unraveling a FAR*
Hi all, Just looking over fole_s_connect() in win32ole.c and I noticed this bit: hr = CLSIDFromProgID(pBuf, &clsid); ... hr = GetActiveObject(&clsid, 0, &pUnknown); ... hr = pUnknown->lpVtbl->QueryInterface( pUnknown, &IID_IDispatch, (void **)&pDispatch ); Using win32-api, that would be something like: IID_IUnknown =
2006 Oct 06
13
Need some help with latest win32-mmap
Hi all, I''ve got the latest win32-mmap code checked into CVS. Unfortunately, it seems that I''m not able to open an existing mapping and retrieve set data. Below is a simple example that seems like it ought to work but doesn''t. Any ideas? # map1.rb require ''win32/mmap'' include Win32 mmap = MMap.new(:name => ''alpha'', :size
2006 May 22
9
win32/service... still with problems.
Hello list, In my quest to get Mongrel working as service for win32, found some problems with win32/service that make it impossible to solve. Attached is the simplest service script I could do with ruby, which depends on win32/service. I found that doing anything complex in service_stop (killing threads, doing file handling, even sleeping for 0.25 seconds). crash the service with backtraces (of
2008 Jun 25
3
[OT] Byacc error
Hi all, Yeah, I''m going OT here... I''m not entirely sure I understand how Ruby builds parse.y on Windows, but it works. However, when I changed all instances of "Ruby" to "Sapphire", and renamed all the source files, I suddenly started getting this error: byacc ./parse.y ''byacc'' is not recognized as an internal or external command,
2008 Jan 16
2
Problem with win32-open3 and net-ping
Hi all, I''m seeing strange behavior with net-ping on Windows, which uses win32-open3 (Open3.popen3) behind the scenes. Download (or checkout) net-ping and run this: ruby -Ilib test\tc_pingexternal.rb It looks like the test suite is running twice. What''s happening? Thanks, Dan This communication is the property of Qwest and may contain confidential or privileged
2008 Apr 25
4
win32-mmap test failures
Hi all, This is odd. It looks to me like we have all 4 variations of memcpy set in Windows::MSVCRT::Buffer but somehow this one creeps up. I actually noticed it in a few cases with that earlier mmap sub/replace example, but I wasn''t sure what was happening. Note that windows-api 0.2.3 and windows-pr-0.8.3 are the latest versions in CVS, but this happens with windows-api-0.2.2 and
2007 Sep 25
2
Bug in win32-api with void prototypes?
Hi all, It seems that a void prototype requires an explicit argument in our version of win32/api: C:\>irb irb(main):001:0> require ''win32/api'' => true irb(main):002:0> include Win32 => Object irb(main):003:0> require ''Win32API'' => true # Our version irb(main):004:0> GetLastErrorA = API.new(''GetLastError'',
2006 May 31
7
Getting at MakeOpenFile
Along the same lines as the last question - how can I get to functions like MakeOpenFile via Win32API? It doesn''t seem to be exported by msvcrt-ruby18. Possible? Or am I out of luck? Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have
2007 Dec 05
21
Fwd: win32/process problem
Any ideas? ---------- Forwarded message ---------- From: Christian Kerth <christian.ke... at dynamicmedia.at> Date: Dec 5, 8:28 am Subject: win32/process problem To: comp.lang.ruby I have an application that consists of serveral independent parts. I want to use the Windows Process API to spawn the different processes. e.g. require ''rubygems'' require
2007 Nov 13
1
win32-api idea - wide method first based on $KCODE
All, Currently, the Win32::API.new method will search for the function name, then the ''A'' (ANSI) name, and finally the ''W'' (Wide) name. The code looks something like this: fProc = GetProcAddress(hLibrary, TEXT(RSTRING(v_proc)->ptr)); if(!fProc){ VALUE v_ascii = rb_str_new3(v_proc); v_ascii = rb_str_cat(v_ascii, "A", 1); fProc =