Windows System Information

The following overviews describe the types of system information available.

OverviewDescription
Handles and Objects An object is a data structure that represents a system resource, such as a file, thread, or graphic image. An application cannot directly access object data or the system resource that an object represents. Instead, an application must obtain an object handle, which it can use to examine or modify the system resource.
Registry A system-defined database in which applications and the system store and retrieve configuration information.
System Information Retrieves or sets system configuration, settings, version, and metrics.
System Shutdown Logs off the current user, shuts down the system, or locks the workstation.
Time Retrieves or sets the system time.
Time Provider Retrieves accurate time stamps from hardware or the network, and provides time stamps to other clients on the network.

[링크 : http://msdn.microsoft.com/en-us/library/ms725495(VS.85).aspx]


후배가 CPU load를 구하는 방법과 함수를 말해주길래, 한번 찾아 봤더니..
의외의 키워드라서.. 내가 지금까지 검색을 못했던 부분이 나와서 충격 -ㅁ-!

아무튼 CPU load 쪽은 Time에 존재한다. 그 외에 각종 시스템 관련 정보들을 report 하기 위해서는
이쪽 함수들을 사용하면 될듯 하다.
Posted by 구차니
개소리 왈왈2009. 3. 29. 13:59

네이버와 다음 웹툰을 보는 취미를 가진 나인데..
오늘 업데이트된 만화들을 보다 보니 리플에 호연작가님이 심장병 때문에
위급하다는 리플들이 달려서 확인을 조금 할 겸 이것저것 검색을 해보았다.

작가가 어쩌면 나랑 비슷하게 인터넷 상에서 자신을 감추는 쪽을 택해서
찾아봐도 개인 프로필이라던가 학교와 관련된 내용은 안나오지만

호연학사라...
우리 학교 기숙사 이름이고 고고미술사학과라는 레어한 학과가
전국에 몇개 안되는지라, 기숙사 이름 + 학과 이름을 조합해보면 거의 우리 학교 후배라는 생각이 든다.

아무튼.. 그림 캐릭터 상품화 이야기도 몇번이나 왔었지만
거절하고 그렇게 살아오다가 어쩔수 없이 그림도 팔테니 수술비를 도와달라는
작가의 홈페이지글을 보고는 웬지 뭉클해져 오는건 왜일까..


진위여부는 확인을 해봐야겠지만.. 자꾸만 계좌 번호가 눈에 걸리는구나...

[홈페이지 : http://deulmol.egloos.com/]
[네이버 웹툰 도자기 : http://comic.naver.com/webtoon/list.nhn?titleId=22090]


사족 : 그러고 보니.. 27일 이후부터 리퍼러가 작동을 안하고 있군요..
         저만 그런줄 알았더니 티스토리 홈페이지에 다른분들도 안된다고 써놔서 나름 안도중입니다 (응?)

'개소리 왈왈' 카테고리의 다른 글

친구에게 하드를 달라고 했더니  (16) 2009.03.31
가려진 아이콘  (2) 2009.03.30
강동도서관 이용시간  (6) 2009.03.27
SEO에 대한 짧은 의견  (2) 2009.03.23
NateOn 강제 업데이트  (0) 2009.03.23
Posted by 구차니
300번째 글 기념(응?)
완전 날로먹는 Bitmap 구조 분석하기 입니다 ^^;
Visual Studio C++ 6.0 프로젝트이며, 헤더만 있다면 다른 플랫폼도 이식 가능할 듯 합니다.


알림 : 네이버 블로그 / 구차니의 잡동사니 모음에서 같은 거 있는데! 라고 하시면..
        동일 인물입니다라고 밖에 답변을 해드릴게 없습니다 -ㅁ-!

typedef struct tagBITMAPFILEHEADER
{
  WORD  bfType;
  DWORD bfSize;
  WORD  bfReserved1;
  WORD  bfReserved2;
  DWORD bfOffBits;
} BITMAPFILEHEADER,  *PBITMAPFILEHEADER;
WORD bfType;          // 위의 첫 바이트 BM 으로 Bitmap 이라는 의미를 지닌 헤더
DWORD bfSize;         // 0x00075736 = 481078 bytes, 파일 전체 크기(헤더 포함한 전체 파일)
WORD bfReserved1;  // 0x0000 으로 사용하지 않는 부분
WORD bfReserved2;  // 0x0000 으로 사용하지 않는 부분
DWORD bfOffBits;      // 현재 위치로부터 실제 데이터가 존재하는 곳 까지의 거리

bfOffBits는 약간의 설명이 필요하다. 일단 256색상 이하의 비트맵은 indexed color 방식으로
팔레트를 이용하게 된다. 팔레트 이후에는 1pixel = 1byte로 연결된 인덱스들이 나열되어 있다.
그런 이유로, 팔레트에 저장된 색상의 갯수가 다르거나, 팔레트를 사용하지 않는다면 이 값은 상당히 다른 값을 보이게 된다.
자세한 내용은 아래의 팔레트를 참고하면 된다.

typedef struct tagBITMAPINFO { BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[1]; } BITMAPINFO, *PBITMAPINFO;
256 색 이하의 이미지라면, RGBQUAD는 팔레트로 사용되고,
16bit 이상의 이미지라면 이 내용에 바로 pixel별 색상이 들어간다.

typedef struct tagBITMAPINFOHEADER
{
  DWORD biSize;
  LONG  biWidth;
  LONG  biHeight;
  WORD  biPlanes;
  WORD  biBitCount;
  DWORD biCompression;
  DWORD biSizeImage;
  LONG  biXPelsPerMeter;
  LONG  biYPelsPerMeter;
  DWORD biClrUsed;
  DWORD biClrImportant;
} BITMAPINFOHEADER,  *PBITMAPINFOHEADER;
DWORD biSize;                      // BITMAPINFO 헤더의 크기
LONG  biWidth;                      // 이미지의 넓이(화면상에 보이는 크기)
LONG  biHeight;                     // 이미지의 높이(화면상에 보이는 크기)
WORD  biPlanes;                    // 이미지의 장수(bitmap은 layer가 존재하지 않으므로 항상 1)
WORD  biBitCount;                  // 한 픽셀의 컬러 비트수(256컬러는 2^8 이므로 8이 표기됨)
DWORD biCompression;          // 비트맵이 압축이 되었는지 어떠한 방식으로 압축이 되었는지 표시
DWORD biSizeImage;
LONG  biXPelsPerMeter;
LONG  biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;

typedef struct tagRGBQUAD
{
  BYTE rgbBlue;
  BYTE rgbGreen;
  BYTE rgbRed;
  BYTE rgbReserved;
} RGBQUAD;

BYTE rgbBlue;            // RGB 중 파랑(Blue)에 대한 값
BYTE rgbGreen;          // RGB 중 녹색(Green)에 대한 값
BYTE rgbRed;             // RGB 중 빨강(Red)에 대한 값
BYTE rgbReserved;     // 사용하지 않음

---------------------------------------------------------------------------------------------------
1.
bitmap은 단순하게, 하나의 pixel에 대한 RGB 정보나 index 정보를 이용하여 이미지를 표시한다.
pixelPicture Element의 약자이며, 우리가 말하는 점 하나를 의미한다.

2.
비트맵은 4사분면을 기준 좌표로 사용하며,
좌상단이 (0.0)이다. 하지만 pc에서는 1사분면을 기준 좌표로 사용하므로 우하단이 (0,0)이다.
그런 이유로, 좌표대로 출력을 하면 비트맵은 상하가 뒤집힌 채로 나오게 된다.
(다르게 말하면, 저장시에 데이터는 상하가 뒤집힌 채로 저장되어 있다)

3.
비트맵은 특정 크기의 데이터를 한번에 전송하기 위해 DMA(Direct Memory Access)나 BLIT(Bit-Block Transfer)를
사용한다. 그런 이유로 특정 블럭을 맞추어 주어야 하고, 그렇기 때문에 이미지는 byte align이나 DWORD align
사용하게 된다(DWORD = 4bytes = 64bit) 이 방법은 몇 비트 이미지냐에 따라 달라지게 되는데,
기본적으로는 4byte align을 맞춰준다.

4.
256색 미만의 비트맵은 팔레트라는 것을 사용한다. (팔레트는 RGBQUAD 구조체 사용)
이러한 팔레트는 8bit로 표현이 가능하므로, 256가지의 색상을 팔레트로 주로 사용가능하다.
예를 들어

이러한 팔레트를 만들고, 번호만으로 각 픽셀별로 색상을 지정해준다. 그렇다면 상당한 저장 공간을 아낄 수 있다.
그런 이유로, 팔레트를 사용하는 경우에는 팔레트를 Lookup(참조) 하여 변환을 해야하는 작업이 추가되게 된다.
grayscale의 경우에는 256color RGBQUAD 구조체
팔레트가 없을 경우(jpeg 변환등) for(i=0;i<256;i++) ; 을 이용하여 생성하면 된다.

5.
이유는 모르겠지만, 24bit 비트맵의 경우는 RGBQUAD가 아닌 RGBTRIPLE이라는 구조를 사용한다.

6. 정리를 하자면
1bit - RGBQUAD 팔레트 2개 / 1byte = 8 pixel / 1byte align 4byte align(2009.10.12 windows 그림판 확인)
2bit -
RGBQUAD 팔레트 4개 / 1byte = 4 pixel / 1byte align
4bit - RGBQUAD 팔레트 16개 / 1byte = 2 pixel / 1byte align
8bit - RGBQUAD 팔레트 256개 / 1byte = 1 pixel / 4byte align
16bit - RGBTRIPLE / 2byte = 1 pixel / 4byte align
24bit - RGBTRIPLE / 3byte = 1 pixel / 4byte align (width * 3)을 한뒤 align
32bit - RGBQUAD  / 4byte = 1 pixel / 4byte align 픽셀이 이미 4의 배수이므로 align 안해도 상관없음

 BITMAPFILEINFO
 http://msdn.microsoft.com/en-us/library/dd183374(VS.85).aspx
 BITMAPINFO  http://msdn.microsoft.com/ko-kr/library/dd183375(en-us,VS.85).aspx
 BITMAPINFOHEADER  http://msdn.microsoft.com/ko-kr/library/dd183376(en-us,VS.85).aspx
 RGBQUAD  http://msdn.microsoft.com/ko-kr/library/dd162938(en-us,VS.85).aspx

 BITMAPCOREINFO  http://msdn.microsoft.com/en-us/library/dd183373(VS.85).aspx
 BITMAPCOREHEADER  http://msdn.microsoft.com/en-us/library/dd183372(VS.85).aspx
 RGBTRIPLE  http://msdn.microsoft.com/en-us/library/dd162939(VS.85).aspx

'모종의 음모 > Bitmap 조작' 카테고리의 다른 글

원하는 크기안에 꼭 맞는 크기얻기  (0) 2009.06.25
Posted by 구차니
Microsoft/Windows2009. 3. 27. 16:19
제목은 저렇게 적었지만, 제대로 되는지는 모르겠다.
내꺼에서 해보니.. 의도한 것 처럼 많이 나오지 않는다 ㄱ-

C:\>ipconfig /displaydns

Windows IP Configuration

         1.0.0.127.in-addr.arpa
         ----------------------------------------
         Record Name . . . . . : 1.0.0.127.in-addr.arpa.
         Record Type . . . . . : 12
         Time To Live  . . . . : 579879
         Data Length . . . . . : 4
         Section . . . . . . . : Answer
         PTR Record  . . . . . : localhost


         minimonk.tistory.com
         ----------------------------------------
         Record Name . . . . . : minimonk.tistory.com
         Record Type . . . . . : 1
         Time To Live  . . . . : 2
         Data Length . . . . . : 4
         Section . . . . . . . : Answer
         A (Host) Record . . . : 211.172.252.15



C:\>ipconfig /?

USAGE:
    ipconfig [/? | /all | /renew [adapter] | /release [adapter] |
              /flushdns | /displaydns | /registerdns |
              /showclassid adapter |
              /setclassid adapter [classid] ]

where
    adapter         Connection name
                   (wildcard characters * and ? allowed, see examples)

    Options:
       /?           Display this help message
       /all         Display full configuration information.
       /release     Release the IP address for the specified adapter.
       /renew       Renew the IP address for the specified adapter.
       /flushdns    Purges the DNS Resolver cache.
       /registerdns Refreshes all DHCP leases and re-registers DNS names
       /displaydns  Display the contents of the DNS Resolver Cache.
       /showclassid Displays all the dhcp class IDs allowed for adapter.
       /setclassid  Modifies the dhcp class id.



Displaying or clearing the DNS Resolver Cache in Windows

ipconfig /displaydns

With the displaydns option you can display the contents of the DNS Resolver Cache



[발견 1: http://www.myptsmail.com/blog/?p=333]

[발견 2: http://www.windowsnetworking.com/kbase/WindowsTips/WindowsXP/AdminTips/Network/ManagetheDNSresolvercachewithIPCONFIG.html]

Posted by 구차니
  

기본 사이즈의 팝업 / 확대해 본 팝업창


다른 사람 pc에서 뜬걸 캡쳐 하고, 내 자리에서는 잘 안뜨길래 일단 캡쳐만 해봤다.
날짜까지 명시하고는 상당히 협박성으로 적어 놓는다.

그런데.. 1280x1024 사이즈에 맞춰서 디자인한건 의도한 걸까? 엿 먹으란걸까?
그리고, 첫 기본 페이지가 daum.net 이었는데, 별다른 것 없이 바로 팝업으로 별도로 뜨는 것 봐서는
패킷 변조가 아닐까 생각이 되는데..
자기네 페이지에 남의 페이지로 무단으로 redirection 하거나 embed 하는 건 불법이 아닌가?

적고나서 테스트로 다른 페이지를 하니 드디어 떠서 소스 캡쳐!
이것은 congnamul.com 접속시에 뜬 불법(?!) 하게 리다이렉션 시켜주는 소스
<html>
    <frameset rows='*,0' border='0'>
    <frame src='http://www.congnamul.com/?' name='dolla' scrolling='yes' >
    <frame src='http://210.217.72.119/xs_btn/shvn.asp?n=2&u=398940&i=40&y=0&m=31&k=0&t=Y&b=388&=www.congnamul.com&s=600&d=2009-03-30' >
    </frameset>
</html>



이것은 daum.net 접속시에 뜬 불법(?!) 하게 리다이렉션 시켜주는 소스
<html>
    <frameset rows='*,0' border='0'>
    <frame src='http://www.daum.net/?' name='dolla' scrolling='yes' >
    <frame src='http://210.217.72.119/xs_btn/shvn.asp?n=2&u=398940&i=40&y=0&m=31&k=0&t=Y&b=388&x=www.daum.net&s=600&d=2009-03-30' >
    </frameset>
</html> 




그래서 저 페이지를 접속했더니 은근히 치밀한 녀석들일세?
<script>history.go(-1);</script>



IE로 접속해서 본 리다이렉션 페이지
승인되지 않았다고 에러가 발생한다.

FireFox로 접속해서 본 리다이렉션 페이지
IE와는 다르게 디렉터리 나열이 거부되었다고 뜬다.
Posted by 구차니
개소리 왈왈2009. 3. 27. 14:04
이용시간
구 분
이용대상
월 - 금요일
토,일요일
종합자료실
중학생이상
09:00~20:00 (동절기:09:00~19:00)
09:00~17:00
어린이열람실
유아 및 초등학생
09:00~18:00
디지털자료실
중학생이상
09:00~18:00
일반열람실
중학생이상
07:00~22:00 (동절기:8:00~22:00)
평일과 동일함

      ☞ 도서관 이용법

휴관일

    - 매월 첫째, 셋째 목요일
    - 일요일을 제외한 법정공휴일 및 임시공휴일
    - 기타 관장이 필요하다고 인정하는 날

[강동 도서관 : http://www.gangdonglib.go.kr/index.php]


시립/구립 도서관들이 주말에도 한다는 정보를 입수하고,
오랫만에 한번 지역 도서관 홈페이지를 들러 보았더니 토요일에도 한다 +_+!

도서관을 다시 좀 괴롭혀야겠다 ㅋㅋ

'개소리 왈왈' 카테고리의 다른 글

가려진 아이콘  (2) 2009.03.30
네이버 웹툰 도자기 작가 '호연'님에게 성금을  (4) 2009.03.29
SEO에 대한 짧은 의견  (2) 2009.03.23
NateOn 강제 업데이트  (0) 2009.03.23
완벽한 S라인!  (6) 2009.03.21
Posted by 구차니
프로그램 사용2009. 3. 27. 11:32
Having a low ID does not mean that no upload or download is possible but has several disadvantages:

1) No IP is known of the machine
eMule is running on therefore all requests like queue or connection requests to this client have to be routed over the server, the low ID client is connected to. This routing causes considerable amount of CPU load on the server thus reducing the maximum number of users the server can cope with. Lugdunum’s servers limit the number low ID users or even ban them at all.

2) Two clients on low ID cannot connect to each other, as it is not possible to route messages over two different servers. This will lead to
less sources for the downloads.

3) On busy servers it may well happen that the messages get lost and eMule misses important information about queue progression or download requests. This may lead to fewer credits and worse downloads.

[출처 : http://www.thefreewindows.com/?p=190]
Posted by 구차니
MCI 함수들을 찾다 보니 두개의 함수가 눈에 띄었다.
waveInOpen()
waveOutOpen()

MCI 함수중에 이녀석이 눈에 띈 이유는, wave를 받아오고 보내주는 장치를 열수 있을 가능성이 있어 보여서였다.
그래서 이 함수들로 검색을 해보니 조금 나오긴한다..

"소프트웨어 오디오 코덱 low-level document" 라는
유용한 문서가 발견되었는데, 출처가 불분명해서 출처를 추적해보았는데 이래저래 원본이 보이지 않는다.
아무튼 그나마 근접해 보이는 것은

볼랜드 포럼 글에서 발견한
자세한 것은 아래 "소프트웨어 오디오 코덱 low-level document"를 참조하세요.
  http://netbeta.sogang.ac.kr/%7Esuchduck/audio_low.html 라는 글인데.. 이 링크는 깨져있다..

결론은 아쉽게도 발견 실패




대충 훑어봐서 자세한 내용은 다시 읽어 봐야겠지만,
아무래도 166Mhz 시절에 쓴글이라 지금에는 어느정도 커버할 수 있을지는 몰라도,
네트워크를 통한 화상채팅에 대한 내용으로, 네트워크 전송의 부하로 인해서 어느정도 크기로 한번에 보낸다는 의미이다.
그리고 윈도우 메시지 기반으로 작동하기에, 실시간으로 하기에는 힘들지 않을까라는 생각도 든다.

'모종의 음모 > noise cancelling' 카테고리의 다른 글

WAVEFORMATEX structure  (0) 2009.04.01
음속  (0) 2009.03.30
sampling rate 관련 의문  (2) 2009.03.26
wav format 관련 문서  (0) 2009.03.26
openGL audio spectrum visualization - sndpeek  (0) 2009.03.19
Posted by 구차니
문득 22KHz로 샘플링된 wav 파일 헤더를 분석하다 의문에 빠졌다.

22KHz라면 현실세계는 1000Hz = 1KHz 니까 22000Hz가 되어야 하는데
실제로 들어 있는 값은 22050Hz 이다. 오잉?

검색해보니
11KHz는 11025Hz
22KHz는 22050Hz
44KHz는 44100Hz
란다.


이유? 모른다 -ㅁ-

Although I've mentioned the period as being the duration of one cycle of a sound wave, it is also used to describe the duration of one sample. For example, at 22kHz, the period of each sample is 1/22050s = 0.000045351 seconds (Note that 22kHz rarely equals 22000Hz. A 22kHz sound system would typically run at 22050Hz, and it is only written as 22kHz as a matter of convenience. Similarly 11kHz is 11025Hz and 44kHz is 44100Hz). This means that, every 0.00045351 seconds, the sound hardware reads a sample from the sound buffer, converts it to a voltage, and sends it to the speaker.

[참고 : http://www.iconbar.com/comments/rss/news1209.html]

An audio CD can represent frequencies up to 22.05 kHz, the Nyquist frequency of the 44.1 kHz sample rate.

[출처 : http://en.wikipedia.org/wiki/Red_Book_(audio_CD_standard)]

The audio CD has a specified bandwidth ceiling of 20kHz, leaving a small gap between that upper frequency and half the sampling rate which is 22.05kHz. The filter must be very steep (high order) to remove information above 22.05kHz but still leaving information under 20kHz. Such a filter was developed at the inception of CD playback and was named the "brickwall filter". This filter had a terrible impact on sound quality.

[출처 : http://www.simaudio.com/edu_upsampling.htm]

An audio frequency (abbreviation: AF), or audible frequency is characterized as a periodic vibration whose frequency is audible to the average human. While the range of frequencies that any individual can hear is largely related to environmental factors, the generally accepted standard range of audible frequencies is 20 to 20,000 hertz. Frequencies below 20 Hz can usually be felt rather than heard, assuming the amplitude of the vibration is high enough. Frequencies above 20,000 Hz can sometimes be sensed by young people, but high frequencies are the first to be affected by hearing loss due to age and/or prolonged exposure to very loud noises.

[출처 : http://en.wikipedia.org/wiki/Audio_frequency]


아마도.. 추측성 발언이긴 하지만,
인간의 가청주파수 영역이 20Hz ~ 20000Hz(20KHz) 인데,
다른 주파수와의 gap을 위해 약간의 간격을 더 주어서 22.05kHz를 CD의 기본 주파수로 한 것 같다.
물론 나이키스트 이론(Nyquist Theroy)에 의해서 최대 주파수의 2배로 샘플링을 해야 하므로 44.1kHz가 된 것이고 말이다.

'모종의 음모 > noise cancelling' 카테고리의 다른 글

음속  (0) 2009.03.30
waveInOpen() waveOutOpen()  (0) 2009.03.26
wav format 관련 문서  (0) 2009.03.26
openGL audio spectrum visualization - sndpeek  (0) 2009.03.19
MCI Reference  (2) 2009.03.19
Posted by 구차니

'모종의 음모 > noise cancelling' 카테고리의 다른 글

waveInOpen() waveOutOpen()  (0) 2009.03.26
sampling rate 관련 의문  (2) 2009.03.26
openGL audio spectrum visualization - sndpeek  (0) 2009.03.19
MCI Reference  (2) 2009.03.19
소음제거 프로그램  (0) 2009.03.16
Posted by 구차니